summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorMichael Kuhn <suraia@ikkoku.de>2017-01-24 00:29:25 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2017-01-23 15:29:25 -0800
commit258dfc707de77d63843cd85d0886ef0ef82e6eb7 (patch)
treee4172ff7ab24bad056acebfb78ee688572185d46 /share
parentc76088906e91af11a343decb5ae532be1d48d896 (diff)
downloadspack-258dfc707de77d63843cd85d0886ef0ef82e6eb7.tar.gz
spack-258dfc707de77d63843cd85d0886ef0ef82e6eb7.tar.bz2
spack-258dfc707de77d63843cd85d0886ef0ef82e6eb7.tar.xz
spack-258dfc707de77d63843cd85d0886ef0ef82e6eb7.zip
Export spack function so it works in subshells (#2908)
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.