setup-env: allow users to skip slow parts (#24545)
This commit is contained in:
parent
a22686279c
commit
0c5402ea5c
@ -699,11 +699,12 @@ set -xg _sp_shell "fish"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if test -z "$SPACK_SKIP_MODULES"
|
||||||
#
|
#
|
||||||
# Check whether we need environment-variables (module) <= `use` is not available
|
# Check whether we need environment-variables (module) <= `use` is not available
|
||||||
#
|
#
|
||||||
set -l need_module "no"
|
set -l need_module "no"
|
||||||
if test -z "$SPACK_SKIP_MODULES"; and not functions -q use; and not functions -q module
|
if not functions -q use; and not functions -q module
|
||||||
set need_module "yes"
|
set need_module "yes"
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -764,6 +765,7 @@ if test -z "$MODULEPATH"
|
|||||||
set -gx MODULEPATH
|
set -gx MODULEPATH
|
||||||
end
|
end
|
||||||
sp_multi_pathadd MODULEPATH $_sp_tcl_roots
|
sp_multi_pathadd MODULEPATH $_sp_tcl_roots
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -306,11 +306,6 @@ _spack_fn_exists() {
|
|||||||
LANG= type $1 2>&1 | grep -q 'function'
|
LANG= type $1 2>&1 | grep -q 'function'
|
||||||
}
|
}
|
||||||
|
|
||||||
need_module="no"
|
|
||||||
if [ -z "${SPACK_SKIP_MODULES+x}" ] && ! _spack_fn_exists use && ! _spack_fn_exists module; then
|
|
||||||
need_module="yes"
|
|
||||||
fi;
|
|
||||||
|
|
||||||
# Define the spack shell function with some informative no-ops, so when users
|
# Define the spack shell function with some informative no-ops, so when users
|
||||||
# run `which spack`, they see the path to spack and where the function is from.
|
# run `which spack`, they see the path to spack and where the function is from.
|
||||||
eval "spack() {
|
eval "spack() {
|
||||||
@ -334,6 +329,12 @@ for cmd in "${SPACK_PYTHON:-}" python3 python python2; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -z "${SPACK_SKIP_MODULES+x}" ]; then
|
||||||
|
need_module="no"
|
||||||
|
if ! _spack_fn_exists use && ! _spack_fn_exists module; then
|
||||||
|
need_module="yes"
|
||||||
|
fi;
|
||||||
|
|
||||||
#
|
#
|
||||||
# make available environment-modules
|
# make available environment-modules
|
||||||
#
|
#
|
||||||
@ -376,6 +377,7 @@ _sp_multi_pathadd() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
_sp_multi_pathadd MODULEPATH "$_sp_tcl_roots"
|
_sp_multi_pathadd MODULEPATH "$_sp_tcl_roots"
|
||||||
|
fi
|
||||||
|
|
||||||
# Add programmable tab completion for Bash
|
# Add programmable tab completion for Bash
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user