Skip to content

Commit ca446fc

Browse files
committed
wip
1 parent 2b82e91 commit ca446fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/functions

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55

66
scan_files() {
77
# 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.
8+
# scanner with the remaining parameters. Return zero if all $cmd succeeded,
9+
# non-zero otherwise.
1010

1111
local mime_type="$1"
12-
local cmd="$2"
12+
shift
1313

1414
# shellcheck disable=SC2016
1515
find . -path ./.git -prune -o -print0 | \
1616
xargs -0n1 sh -c 'test "$(file --brief --mime-type "$1")" = "'"$mime_type"'" && printf "%s\000" "$1"' -- | \
17-
xargs -0t -- $cmd
17+
xargs -0t -- "$@"
1818
}

0 commit comments

Comments
 (0)