From fd845be260a5af9d1fae6bf46d7f10b05ff4160e Mon Sep 17 00:00:00 2001 From: redxef Date: Tue, 22 Nov 2022 00:22:37 +0100 Subject: [PATCH] Remove multiple calls to jq. --- src/common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common b/src/common index c39cc48..4af0131 100755 --- a/src/common +++ b/src/common @@ -54,7 +54,7 @@ get_hostkey() { jq -r .source.hostkey < "$INPUT_PATH" } get_files() { - jq -r '.source.files // []' < "$INPUT_PATH" | jq -r '.[]' + jq -r '(.source.files // [])[]' < "$INPUT_PATH" } get_directory() { jq -r '.source.directory // "$HOME"' < "$INPUT_PATH" | sed 's|/$||' @@ -66,7 +66,7 @@ get_version() { jq -r .version < "$INPUT_PATH" | jq -r tostring } get_command() { - jq -r '.params.command // ["true"]' < "$INPUT_PATH" | jq -r '.[]' | tr '\n"' " '" + jq -r '(.params.command // ["true"])[]' < "$INPUT_PATH" | tr '\n"' " '" } get_stderr_file() { jq -r '.params.stderr_file // "-"' < "$INPUT_PATH"