We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b82e91 commit ca446fcCopy full SHA for ca446fc
scripts/functions
@@ -5,14 +5,14 @@
5
6
scan_files() {
7
# For all files under $PWD except under .git that match $mime_type, run the
8
- # scanner $cmd (expanded by shell word splitting). Return zero if all $cmd
9
- # succeeded, non-zero otherwise.
+ # scanner with the remaining parameters. Return zero if all $cmd succeeded,
+ # non-zero otherwise.
10
11
local mime_type="$1"
12
- local cmd="$2"
+ shift
13
14
# shellcheck disable=SC2016
15
find . -path ./.git -prune -o -print0 | \
16
xargs -0n1 sh -c 'test "$(file --brief --mime-type "$1")" = "'"$mime_type"'" && printf "%s\000" "$1"' -- | \
17
- xargs -0t -- $cmd
+ xargs -0t -- "$@"
18
}
0 commit comments