Skip to content

Commit

Permalink
Fixing module load and check in hellModuleHostname
Browse files Browse the repository at this point in the history
  • Loading branch information
tefirman committed Jan 29, 2025
1 parent 48249d8 commit 493f3de
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions helloModuleHostname/helloModuleHostname.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,14 @@ task Hostname {
hostname

# List loaded modules and verify our module is loaded
source /app/lmod/lmod/init/profile
module list 2>&1 | tee module_list.txt

# Extract just the module name without version for more flexible matching
MODULE_BASE=$(echo "~{module_env}" | cut -d'/' -f1)

# Check if the module or its base name is in the loaded modules
if grep -q "~{module_env}\|${MODULE_BASE}/" module_list.txt; then
if grep -q "~{module_env}" module_list.txt; then
echo "true" > module_verified.txt
echo "Successfully verified module ~{module_env} is loaded"
else
echo "false" > module_verified.txt
echo "ERROR: Module ~{module_env} was not found in loaded modules:"
cat module_list.txt
exit 1
Expand Down

0 comments on commit 493f3de

Please sign in to comment.