From abc7d401e2d411642a9cc2b1de96990da2d17c63 Mon Sep 17 00:00:00 2001
From: Todd Gamblin <tgamblin@llnl.gov>
Date: Fri, 25 Jul 2014 19:39:10 -0700
Subject: [PATCH] Add "spack cd" shell support to cd directly into the staged
 archive.

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

diff --git a/share/spack/setup-env.bash b/share/spack/setup-env.bash
index e22a259167..53c53dfee5 100755
--- a/share/spack/setup-env.bash
+++ b/share/spack/setup-env.bash
@@ -65,6 +65,10 @@ function spack {
     # Filter out use and unuse.  For any other commands, just run the
     # command.
     case $_spack_subcommand in
+        "cd")
+            cd $(spack stage -b "$@")
+            return
+            ;;
         "use") ;;
         "unuse") ;;
         *)
-- 
GitLab