Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/scripts/test_init_scripts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ for shell in ${SHELLS[@]}; do
pattern="{EESSI/${EESSI_VERSION}} "
assert_raises 'echo "$TEST_EESSI_PS1_UPDATE" | grep "$pattern"'
assert_raises 'echo "$TEST_EESSI_NO_PS1_UPDATE" | grep "$pattern"' 1
TEST_EESSI_EXPLICIT_NO_PS1_UPDATE=$($shell -c "unset PS1 ; PS1='test> ' ; export EESSI_MODULE_UPDATE_PS1=0 ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"")
pattern='test> '
assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE" | grep "$pattern"' 1
Comment thread
ocaisa marked this conversation as resolved.
fi

# End Test Suite
Expand Down
7 changes: 6 additions & 1 deletion init/lmod/sh
Comment thread
adammccartney marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,12 @@ if [ -z "$__Init_EESSI_Default_Modules" ]; then
# (in an interactive shell PS1 is likely unset, so let's only do this if it is set)
if [ -n "$PS1" ]; then
export PS1
Comment thread
adammccartney marked this conversation as resolved.
Outdated
export EESSI_MODULE_UPDATE_PS1=1
if [ -n "${__Init_EESSI_MODULE_UPDATE_PS1+x}" ] || [ $((EESSI_MODULE_UPDATE_PS1)) -eq 0 ]; then
export __Init_EESSI_MODULE_UPDATE_PS1=0
unset EESSI_MODULE_UPDATE_PS1
Comment thread
ocaisa marked this conversation as resolved.
else
export EESSI_MODULE_UPDATE_PS1=1
fi
Comment thread
ocaisa marked this conversation as resolved.
Outdated
fi

# Figure out which shell was used to source this script, which we then use to source the corresponding
Expand Down
Loading