Skip to content

Commit 0346615

Browse files
committed
Process arguments in packcheck-safe before passing it to packcheck
1 parent c63358c commit 0346615

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

packcheck-safe.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,28 @@
11
#!/usr/bin/env bash
22

3-
PACKCHECK_DIR=$(dirname $0)
3+
PACKCHECK_DIR=$(dirname "$0")
44
echo "Running ${PACKCHECK_DIR}/packcheck.sh with clean environment and CHECK_ENV on..."
55
echo "No environment variables are honored, you have to specifiy ALL the"
66
echo "parameters explicitly on the command line, including PATH."
77
echo
88

9-
/usr/bin/env -i CHECK_ENV=y $(dirname $0)/packcheck.sh $*
9+
PACKCHECK_CLI_OPTS_ARR=("$@")
10+
PACKCHECK_CLI_OPTS=""
11+
12+
for i in "${PACKCHECK_CLI_OPTS_ARR[@]}"
13+
do
14+
case $i in
15+
*=*)
16+
key=${1%%=*}
17+
val=${1#*=}
18+
PACKCHECK_CLI_OPTS="$PACKCHECK_CLI_OPTS $key=\"$val\""
19+
shift
20+
;;
21+
*)
22+
PACKCHECK_CLI_OPTS="$PACKCHECK_CLI_OPTS $i"
23+
shift
24+
;;
25+
esac
26+
done
27+
28+
eval "/usr/bin/env -i CHECK_ENV=y $PACKCHECK_DIR/packcheck.sh $PACKCHECK_CLI_OPTS"

0 commit comments

Comments
 (0)