From a3c8693b45a138878905f9d2b5e7c382e65f08ed Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 22 Jun 2022 11:30:58 -0500 Subject: [PATCH] refactor(gh): Separate command from args --- docker/entrypoint.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b28c6ec..3b5bc6c 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -34,23 +34,23 @@ fi log "typos: $(typos --version)" log "jq: $(jq --version)" -COMMAND="${CMD_NAME} ${TARGET}" +ARGS="${TARGET}" # Ignore implicit configuration files if [ "${INPUT_ISOLATED:-false}" == "true" ]; then - COMMAND+=" --isolated" + ARGS+=" --isolated" fi # Use a custom configuration file if [[ -n "${INPUT_CONFIG:-}" ]]; then - COMMAND+=" --config ${INPUT_CONFIG}" + ARGS+=" --config ${INPUT_CONFIG}" fi -log "$ ${COMMAND}" -${COMMAND} --format json | +log "$ ${CMD_NAME} ${ARGS}" +${CMD_NAME} ${ARGS} --format json | grep '"type":"typo"' | jq --sort-keys --raw-output '"::warning file=\(.path),line=\(.line_num),col=\(.byte_offset)::\"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")' | while IFS= read -r line; do echo "$line" done || true -${COMMAND} +${CMD_NAME} ${ARGS}