From 258dfc707de77d63843cd85d0886ef0ef82e6eb7 Mon Sep 17 00:00:00 2001
From: Michael Kuhn <suraia@ikkoku.de>
Date: Tue, 24 Jan 2017 00:29:25 +0100
Subject: [PATCH] Export spack function so it works in subshells (#2908)

---
 share/spack/setup-env.sh | 5 +++++
 1 file changed, 5 insertions(+)

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.
-- 
GitLab