Skip to content

Commit 7926c66

Browse files
authored
Update generate_wrappers.sh
1 parent f09158f commit 7926c66

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

generate_wrappers.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ printf -- '%s\n' "_tmp_arr=(\$(echo \$SINGULARITYENV_PATH | /usr/bin/tr ':' '\n'
276276
printf -- '%s\n' "SINGULARITYENV_PATH=\$(echo \"\${_tmp_arr[@]}\" | /usr/bin/tr ' ' ':')" >> _deploy/common.sh
277277
printf -- '%s\n' "_tmp_arr=(\$(echo \$SINGULARITYENV_LD_LIBRARY_PATH | /usr/bin/tr ':' '\n' ))" >> _deploy/common.sh
278278
printf -- '%s\n' "SINGULARITYENV_LD_LIBRARY_PATH=\$(echo \"\${_tmp_arr[@]}\" | /usr/bin/tr ' ' ':')" >> _deploy/common.sh
279+
280+
# Keep Venv path if we wrap a container and create
281+
if [[ "$CW_MODE" == "wrapcont" ]];then
282+
echo '[[ ${VIRTUAL_ENV+defined} && "$(readlink -f $_C_DIR)/bin/python" = $(readlink -f $VIRTUAL_ENV/bin/python) ]] && SINGULARITYENV_PATH="$VIRTUAL_ENV/bin:$SINGULARITYENV_PATH"' >> _deploy/common.sh
283+
fi
284+
279285
if [[ -f _extra_envs.sh ]];then
280286
cat _extra_envs.sh >> _deploy/common.sh
281287
fi

0 commit comments

Comments
 (0)