Commit 9c2da2e5 authored by Zhang, Chen's avatar Zhang, Chen
Browse files

Merge branch 'shiver' into 'main'

Add ability to select another environment (shiver)

See merge request sns-hfir-scse/infrastructure/nsd-app-wrap!31
parents 0b005f7c 109b53bb
Loading
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -2,8 +2,26 @@
# import library to do the real work
source "$(dirname "$(realpath "$0")")/nsd-app-wrap.sh"

# put together arguments - conda_env, application, argv
# look for a supplied argument
for var in "$@"
do
    case "$var" in
	--env=*)
	    CONDA_ENV=$(echo "${var}" | awk -F"=" '{print $2}')
	    shift 1  # remove this argument
	    ;;
	--env)
	    CONDA_ENV="$2" # look ahead by one
	    shift 2  # remove the flag and value
	    ;;
    esac
done
# default conda environment if it was not specified
if [ -z "${CONDA_ENV}" ]; then
    CONDA_ENV="mantid"
fi

# put together arguments - conda_env, application, argv
args=("${CONDA_ENV}" "/opt/anaconda/envs/${CONDA_ENV}/bin/mantidworkbench" "$@")
# launch the tool
activate_and_launch "${args[@]}"
+1 −1
Original line number Diff line number Diff line
%global srcname nsd-app-wrap

Name:           nsd-app-wrap
Version:        1.44
Version:        1.45
Release:        1%{?dist}
Summary:        Wrapper scripts to launch python applications installed via anaconda
Vendor:         Peter F. Peterson

snapred

100644 → 100755
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ fi
if [ -v CONDA_ENVIRON ];
then
    # import library to do the real work
    source "$(dirname $(realpath "$0"))/nsd-app-wrap.sh"
    source "$(dirname "$(realpath "$0")")/nsd-app-wrap.sh"

    # activate the environment - will be deactivated on exit
    activate_conda_environment "${CONDA_ENVIRON}"