Skip to content

Commit

Permalink
do not use /dev/stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Dec 4, 2023
1 parent b67d690 commit 76ae987
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions init/bash
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Allow for a silent mode
if [[ -v EESSI_SILENT ]]; then
# EESSI_SILENT set
output=/dev/null
else
output=/dev/stdout
fi
function show_msg {
msg=$1
if [[ ! -v EESSI_SILENT ]]; then
echo "$msg"
fi
}

## Allow for a silent mode
#if [[ -v EESSI_SILENT ]]; then
# # EESSI_SILENT set
# output=/dev/null
#else
# output=/dev/stdout
#fi

# The following method should be safe, but might break if file is a symlink
# (could switch to $(dirname "$(readlink -f "$BASH_SOURCE")") in that case)
Expand All @@ -20,11 +27,11 @@ if [ $? -eq 0 ]; then
export PATH=$EPREFIX/usr/bin:$EPREFIX/bin:$PATH

# init Lmod
echo "Initializing Lmod..." >> $output
show_msg "Initializing Lmod..."
source $EESSI_EPREFIX/usr/share/Lmod/init/bash

# prepend location of modules for EESSI software stack to $MODULEPATH
echo "Prepending $EESSI_MODULEPATH to \$MODULEPATH..." >> $output
show_msg "Prepending $EESSI_MODULEPATH to \$MODULEPATH..."
module use $EESSI_MODULEPATH

#echo >> $output
Expand Down

0 comments on commit 76ae987

Please sign in to comment.