Skip to content

Commit

Permalink
BF: replace use of mapfile with a while loop
Browse files Browse the repository at this point in the history
Solution provided by chatgpt. The reason is that OSX has elderly bash 3.2.57
(due to licensing issue) which has no mapfile. On Debian I have 5.2.21 now
  • Loading branch information
yarikoptic committed Feb 22, 2024
1 parent 155bf3d commit c919593
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/singularity_cmd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ function pass_git_config() {
VALUES=( "$2" )
else
# read all values into an array
mapfile -t VALUES < <(git config --get-all "$var")
# There is no mapfile on OSX, so can't do
# mapfile -t VALUES < <(git config --get-all "$var")
VALUES=()
while IFS= read -r line; do
VALUES+=("$line")
done < <(git config --get-all "$var")
fi

for value in "${VALUES[@]}"; do
Expand Down

0 comments on commit c919593

Please sign in to comment.