@@ -46,13 +46,12 @@ local MODULEPATH="{{ module_dir }}"
4646setenv (" SINGULARITY_SHELL" , " {{ singularity_shell }}" )
4747setenv (" SINGULARITY_OPTS" , " " )
4848setenv (" SINGULARITY_COMMAND_OPTS" , " " )
49- setenv (" SINGULARITY_COMMAND_ARGS" , " " )
5049
5150-- interactive shell to any container, plus exec for aliases
5251local containerPath = ' {{ container_sif }}'
5352local shellCmd = " singularity ${SINGULARITY_OPTS} shell ${SINGULARITY_COMMAND_OPTS} -s {{ singularity_shell }} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} " .. containerPath
5453local execCmd = " singularity ${SINGULARITY_OPTS} exec ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} "
55- local runCmd = " singularity ${SINGULARITY_OPTS} run ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} " .. containerPath .. " ${SINGULARITY_COMMAND_ARGS} "
54+ local runCmd = " singularity ${SINGULARITY_OPTS} run ${SINGULARITY_COMMAND_OPTS} {% if features.gpu %}{{ features.gpu }} {% endif %}{% if envfile %}-B {{ module_dir }}/{{ envfile }}:/.singularity.d/env/{{ envfile }}{% endif %} {% if bindpaths %}-B {{ bindpaths }}{% endif %} " .. containerPath
5655local inspectCmd = " singularity ${SINGULARITY_OPTS} inspect ${SINGULARITY_COMMAND_OPTS} "
5756
5857-- set_shell_function takes bashStr and cshStr
@@ -73,7 +72,7 @@ if (myShellName() == "bash") then
7372end {% endif % }
7473
7574-- A customizable exec function
76- set_shell_function (" {|module_name|}-exec" , execCmd .. containerPath .. " ${SINGULARITY_COMMAND_ARGS} $ @" , execCmd .. containerPath .. " ${SINGULARITY_COMMAND_ARGS} " )
75+ set_shell_function (" {|module_name|}-exec" , execCmd .. containerPath .. " $@" , execCmd .. containerPath )
7776
7877-- Always provide a container run
7978set_shell_function (" {|module_name|}-run" , runCmd .. " $@" , runCmd )
0 commit comments