Skip to content
Snippets Groups Projects
Commit d7607973 authored by Tom Scogland's avatar Tom Scogland
Browse files

fix for array handling in ancient bash

fixes #284
parent 487ac9cd
No related branches found
No related tags found
No related merge requests found
...@@ -55,13 +55,12 @@ ...@@ -55,13 +55,12 @@
# avoids the need to come up with a user-friendly naming scheme for # avoids the need to come up with a user-friendly naming scheme for
# spack dotfiles. # spack dotfiles.
######################################################################## ########################################################################
arrtest[0]='test' || (echo 'Failure: arrays not supported in this version of bash.' && exit 2)
function spack { function spack {
# save raw arguments into an array before butchering them # save raw arguments into an array before butchering them
args=() declare -a args=( "$@" )
for a in "$@"; do
# yup, this is awful, blame bash2 compat
args=("${args[@]}" "$a")
done
# accumulate initial flags for main spack command # accumulate initial flags for main spack command
_sp_flags="" _sp_flags=""
while [[ "$1" =~ ^- ]]; do while [[ "$1" =~ ^- ]]; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment