summaryrefslogtreecommitdiff
path: root/share/spack/setup-env.sh
diff options
context:
space:
mode:
Diffstat (limited to 'share/spack/setup-env.sh')
-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 0142e04817..9a6090a93b 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -75,6 +75,10 @@ function spack {
# Filter out use and unuse. For any other commands, just run the
# command.
case $_sp_subcommand in
+ "cd")
+ cd $(spack stage --print-build-dir "$@")
+ return
+ ;;
"use"|"unuse"|"load"|"unload")
# Shift any other args for use off before parsing spec.
_sp_module_args=""
@@ -108,6 +112,7 @@ function spack {
;;
*)
command spack $_sp_flags $_sp_subcommand $_sp_spec
+ ;;
esac
}