Make EESSI_MODULE_UPDATE_PS1 configurable#188
Open
adammccartney wants to merge 4 commits intoEESSI:mainfrom
Open
Make EESSI_MODULE_UPDATE_PS1 configurable#188adammccartney wants to merge 4 commits intoEESSI:mainfrom
adammccartney wants to merge 4 commits intoEESSI:mainfrom
Conversation
If the EESSI_MODULE_UPDATE_PS1 is set to "0", then don't update the prompt.
ocaisa
reviewed
Mar 24, 2026
| else | ||
| export EESSI_MODULE_UPDATE_PS1=1 | ||
| fi | ||
| fi |
Member
There was a problem hiding this comment.
There were changed today and I suggest you start again from https://github.com/EESSI/software-layer-scripts/blob/main/init/lmod/sh.
General approach looks ok, but if you call the script twice the EESSI_MODULE_UPDATE_PS1 will be set on the second call. You probably want a structure similar to
if [ -z "$__Init_EESSI_PS1" ]; then
export __Init_EESSI_PS1=1;
...
fi
You should also add a test for this case near https://github.com/EESSI/software-layer-scripts/blob/main/.github/workflows/scripts/test_init_scripts.sh#L145-L153
Member
There was a problem hiding this comment.
For the test it could be
TEST_EESSI_EXPLICIT_NO_PS1_UPDATE=$($shell -c "unset PS1 ; PS1='$ ' ; export EESSI_MODULE_UPDATE_PS1=0 ; . init/lmod/$shell 2>/dev/null ; echo \"\$PS1\"")
...
assert_raises 'echo "$TEST_EESSI_EXPLICIT_NO_PS1_UPDATE" | grep "$pattern"' 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #187