File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -14,20 +14,24 @@ function error() {
1414}
1515
1616# Check if a stack base dir has been specified
17- if [ " $# " -ne 1 ]; then
17+ if [ " $# " -lt 1 ] || [ " $# " -gt 2 ]; then
1818 error " usage: $0 <path to main directory of an EESSI stack>"
1919fi
2020
2121stack_base_dir=" $1 "
22+ update_lmod_system_cache_files=" $2 "
2223
2324# Check if the given stack base dir exists
2425if [ ! -d ${stack_base_dir} ]
2526then
2627 error " ${stack_base_dir} does not point to an existing directory!"
2728fi
2829
29- # Check if Lmod's cache update script can be found at the expected location (in the compatibility layer of the given stack)
30- update_lmod_system_cache_files=" ${stack_base_dir} /compat/linux/$( uname -m) /usr/share/Lmod/libexec/update_lmod_system_cache_files"
30+ # If no Lmod cache update script was specified, try to find one in the compatibility layer of the given stack
31+ if [ -z ${update_lmod_system_cache_files} ]; then
32+ update_lmod_system_cache_files=" ${stack_base_dir} /compat/linux/$( uname -m) /usr/share/Lmod/libexec/update_lmod_system_cache_files"
33+ fi
34+ # Make sure that the expected Lmod cache update script exists
3135if [ ! -f ${update_lmod_system_cache_files} ]
3236then
3337 error " expected to find Lmod's cache update script at ${update_lmod_system_cache_files} , but it doesn't exist."
You can’t perform that action at this time.
0 commit comments