Skip to content

Commit

Permalink
use xargs instead of cat
Browse files Browse the repository at this point in the history
allows possibility of white-space characters in filepaths
  • Loading branch information
tomeichlersmith committed Nov 22, 2024
1 parent d4930c0 commit 19ea462
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,10 @@ shellcheck:
#!/usr/bin/env sh
set -x
format_list=$(mktemp)
git ls-tree -r HEAD | awk '{ if ($1 == 100755 || $4 ~ /\.sh/) print $4 }' > ${format_list}
shellcheck --severity style --shell sh $(cat ${format_list})
git ls-tree -r HEAD | awk '{ if ($1 == 100755 || $4 ~ /\.sh/) print $4 }' \
> "${format_list}"
xargs --arg-file="${format_list}" \
shellcheck --severity style --shell sh
rm "${format_list}"
# check a script recipe also using shellcheck
Expand Down

0 comments on commit 19ea462

Please sign in to comment.