makeWrapper: fix flag handling
When `--add-flags` is not used, `flagsBefore` is unset. This causes an error when invoking `makeWrapper` from a context that sets `-o nounset`, as is done in `buildDotnetModule`. This change makes `makeWrapper` safe for use in these conditions.
This commit is contained in:
parent
4e6190bec3
commit
40fbc97988
1 changed files with 3 additions and 3 deletions
|
@ -166,11 +166,11 @@ makeShellWrapper() {
|
|||
elif [[ "$p" == "--add-flags" ]]; then
|
||||
flags="${params[$((n + 1))]}"
|
||||
n=$((n + 1))
|
||||
flagsBefore="$flagsBefore $flags"
|
||||
flagsBefore="${flagsBefore-} $flags"
|
||||
elif [[ "$p" == "--append-flags" ]]; then
|
||||
flags="${params[$((n + 1))]}"
|
||||
n=$((n + 1))
|
||||
flagsAfter="$flagsAfter $flags"
|
||||
flagsAfter="${flagsAfter-} $flags"
|
||||
elif [[ "$p" == "--argv0" ]]; then
|
||||
argv0="${params[$((n + 1))]}"
|
||||
n=$((n + 1))
|
||||
|
@ -183,7 +183,7 @@ makeShellWrapper() {
|
|||
done
|
||||
|
||||
echo exec ${argv0:+-a \"$argv0\"} \""$original"\" \
|
||||
"$flagsBefore" '"$@"' "$flagsAfter" >> "$wrapper"
|
||||
"${flagsBefore-}" '"$@"' "${flagsAfter-}" >> "$wrapper"
|
||||
|
||||
chmod +x "$wrapper"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue