makeWrapper: add --chdir

For symmetry with `makeBinaryWrapper`.
This commit is contained in:
Naïm Favier 2022-03-14 18:47:29 +01:00
parent c377a6f7f5
commit 10479e4f51
No known key found for this signature in database
GPG Key ID: 49B07322580B7EE2

View File

@ -18,6 +18,7 @@ assertExecutable() {
# --set-default VAR VAL : like --set, but only adds VAR if not already set in
# the environment
# --unset VAR : remove VAR from the environment
# --chdir DIR : change working directory (use instead of --run "cd DIR")
# --run COMMAND : run command before the executable
# --add-flags FLAGS : add FLAGS to invocation of executable
@ -126,6 +127,10 @@ makeWrapper() {
varName="${params[$((n + 1))]}"
n=$((n + 1))
echo "unset $varName" >> "$wrapper"
elif [[ "$p" == "--chdir" ]]; then
dir="${params[$((n + 1))]}"
n=$((n + 1))
echo "cd ${dir@Q}" >> "$wrapper"
elif [[ "$p" == "--run" ]]; then
command="${params[$((n + 1))]}"
n=$((n + 1))