Skip to content

Commit 8aac6a6

Browse files
committed
Add option to make load quiet, and add test for that
1 parent 21e1f65 commit 8aac6a6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/tests_eessi_module.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,8 @@ jobs:
352352
# Pipe the PS1 variable into grep to check for the pattern
353353
echo "$PS1"
354354
echo "$PS1" | grep "$GREP_PATTERN"
355+
356+
# Let's also check that quiet mode works
357+
module load "EESSI/${{matrix.EESSI_VERSION}}" |& grep -q "Module for EESSI/${{matrix.EESSI_VERSION}} loaded successfully"
358+
export EESSI_MODULE_QUIET_LOAD=1
359+
module load "EESSI/${{matrix.EESSI_VERSION}}" |& ! grep -q "Module for EESSI/${{matrix.EESSI_VERSION}} loaded successfully"

init/modules/EESSI/2023.06.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ local quiet_load = false
221221
if os.getenv("EESSI_MODULE_UPDATE_PS1") then
222222
local prompt = os.getenv("PS1")
223223
if prompt then
224-
quiet_load = true
225224
pushenv("PS1", "{EESSI/" .. eessi_version .. "} " .. prompt)
226225
end
227226
end
@@ -234,7 +233,7 @@ if os.getenv("EESSI_MODULE_STICKY") then
234233
end
235234

236235
if mode() == "load" then
237-
if not quiet_load then
236+
if not os.getenv("EESSI_MODULE_QUIET_LOAD") then
238237
LmodMessage(load_message)
239238
end
240239
end

0 commit comments

Comments
 (0)