From 3ce99cf4e18b599a42041a486b82498a0f43a488 Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Wed, 25 Nov 2015 11:02:51 -0800 Subject: fix for the shell arg handling issues The setup-env.sh script now saves off the argument array before shifting off all the arguments so that the final command invocation doesn't arbitrarily requote the arguments. All external quoting is preserved now. This has been thoroughly tested with zsh, but should probably be tested with bash etc. before acceptance. --- share/spack/setup-env.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index b90846d28f..8ee42bb10f 100755 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -56,6 +56,12 @@ # spack dotfiles. ######################################################################## function spack { + # save raw arguments into an array before butchering them + args=() + for a in "$@"; do + # yup, this is awful, blame bash2 compat + args=("${args[@]}" "$a") + done # accumulate initial flags for main spack command _sp_flags="" while [[ "$1" =~ ^- ]]; do @@ -116,7 +122,7 @@ function spack { esac ;; *) - command spack $_sp_flags $_sp_subcommand $_sp_spec + command spack "${args[@]}" ;; esac } -- cgit v1.2.3-70-g09d2