summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/spack/csh/spack.csh4
-rwxr-xr-xshare/spack/setup-env.sh5
2 files changed, 9 insertions, 0 deletions
diff --git a/share/spack/csh/spack.csh b/share/spack/csh/spack.csh
index 169e9878bf..6073673333 100644
--- a/share/spack/csh/spack.csh
+++ b/share/spack/csh/spack.csh
@@ -45,6 +45,10 @@ set _sp_spec=""
# Figure out what type of module we're running here.
set _sp_modtype = ""
switch ($_sp_subcommand)
+case "cd":
+ shift _sp_args
+ cd `spack stage --print-build-dir $_sp_args`
+ breaksw
case use:
case unuse:
case load:
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
}