summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/setup-env.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index 943db72612..24ab3dae6f 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -167,6 +167,11 @@ function _spack_pathadd {
fi
}
+# Export spack function so it is available in subshells (only works with bash)
+if [ -n "${BASH_VERSION:-}" ]; then
+ export -f spack
+fi
+
#
# Figure out where this file is. Below code needs to be portable to
# bash and zsh.