Skip to content

Commit 109dbef

Browse files
author
Caspar van Leeuwen
committed
Fix bug when multiple modules where defined. In the old syntax, they were interpreted as a single string, with space. I.e. only one iteration of hte for loop was executed. Using bash arrays, we no longer have this issue
1 parent 224e170 commit 109dbef

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bot/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ mkdir -p ${SINGULARITY_TMPDIR}
115115

116116
# load modules if LOAD_MODULES is not empty
117117
if [[ ! -z ${LOAD_MODULES} ]]; then
118-
for mod in $(echo ${LOAD_MODULES} | tr ',' '\n')
118+
IFS=',' read -r -a modules <<< "$(echo "${LOAD_MODULES}")"
119+
for mod in "${modules[@]}";
119120
do
120121
echo "bot/build.sh: loading module '${mod}'"
121122
module load ${mod}

0 commit comments

Comments
 (0)