Skip to content

Commit 7307789

Browse files
committed
bundle-script.sh: Fix trailing space and backslashes erroneously being removed
1 parent fbb218f commit 7307789

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

bundle-script.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ fi
3232
shopt -s extglob
3333
echo "" > "$output_script"
3434
line_no=1
35-
while read line
35+
36+
while IFS= read -r line
3637
do
3738
if [[ "$line" =~ ^" "*("source "|". ").* ]]
3839
then
@@ -88,9 +89,9 @@ then
8889
expected="${KW_ARGS['--exit']-$expected}"
8990

9091
bash "$output_script" $check_args > /dev/null 2>&1 || rc=$?
91-
if [[ $rc -ne $expected ]]
92+
if [[ "$rc" -ne "$expected" ]]
9293
then
93-
echo "ERROR: The bundled script doesn't seem to work ('bash \"$output_script\" $check_args' terminated with exit code $?)!" >&2
94+
echo "ERROR: The bundled script doesn't seem to work ('bash \"$output_script\" $check_args' terminated with exit code $rc not $expected)!" >&2
9495
exit 2
9596
fi
9697
fi

0 commit comments

Comments
 (0)