From df62451fcd917ab8ca132ce2c764ad312b6a85d9 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 21 Apr 2021 17:58:59 +0200 Subject: [PATCH] sh: add helper script to fix the figure subtitle --- garlic/sh/fix-figure-subtitle.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 garlic/sh/fix-figure-subtitle.sh diff --git a/garlic/sh/fix-figure-subtitle.sh b/garlic/sh/fix-figure-subtitle.sh new file mode 100755 index 0000000..a98614b --- /dev/null +++ b/garlic/sh/fix-figure-subtitle.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +if grep -q 'output = args[2]' "$1"; then exit 0; fi + +sed '/length(args)>0/aif (length(args)>1) { output = args[2] } else { output = "?" }' -i "$1" +sed '/jsonlite::flatten/,$s/input_file/output/g' -i "$1"