mirror of
https://github.com/crate-ci/typos.git
synced 2024-11-25 18:41:05 -05:00
refactor(gh): Separate command from args
This commit is contained in:
parent
87effb2664
commit
a3c8693b45
1 changed files with 6 additions and 6 deletions
|
@ -34,23 +34,23 @@ fi
|
||||||
log "typos: $(typos --version)"
|
log "typos: $(typos --version)"
|
||||||
log "jq: $(jq --version)"
|
log "jq: $(jq --version)"
|
||||||
|
|
||||||
COMMAND="${CMD_NAME} ${TARGET}"
|
ARGS="${TARGET}"
|
||||||
|
|
||||||
# Ignore implicit configuration files
|
# Ignore implicit configuration files
|
||||||
if [ "${INPUT_ISOLATED:-false}" == "true" ]; then
|
if [ "${INPUT_ISOLATED:-false}" == "true" ]; then
|
||||||
COMMAND+=" --isolated"
|
ARGS+=" --isolated"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use a custom configuration file
|
# Use a custom configuration file
|
||||||
if [[ -n "${INPUT_CONFIG:-}" ]]; then
|
if [[ -n "${INPUT_CONFIG:-}" ]]; then
|
||||||
COMMAND+=" --config ${INPUT_CONFIG}"
|
ARGS+=" --config ${INPUT_CONFIG}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "$ ${COMMAND}"
|
log "$ ${CMD_NAME} ${ARGS}"
|
||||||
${COMMAND} --format json |
|
${CMD_NAME} ${ARGS} --format json |
|
||||||
grep '"type":"typo"' |
|
grep '"type":"typo"' |
|
||||||
jq --sort-keys --raw-output '"::warning file=\(.path),line=\(.line_num),col=\(.byte_offset)::\"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")' |
|
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
|
while IFS= read -r line; do
|
||||||
echo "$line"
|
echo "$line"
|
||||||
done || true
|
done || true
|
||||||
${COMMAND}
|
${CMD_NAME} ${ARGS}
|
||||||
|
|
Loading…
Reference in a new issue