summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-10-15 23:04:45 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2018-11-09 00:31:24 -0800
commita1818f971f20e4b9ac22dad70b95d764921acbe4 (patch)
treec35fcb16dfa42ccc6f17d7e73d5497490b10dbb0 /share
parent9fb37dfd765a2439d5f739581c39fa6176d03551 (diff)
downloadspack-a1818f971f20e4b9ac22dad70b95d764921acbe4.tar.gz
spack-a1818f971f20e4b9ac22dad70b95d764921acbe4.tar.bz2
spack-a1818f971f20e4b9ac22dad70b95d764921acbe4.tar.xz
spack-a1818f971f20e4b9ac22dad70b95d764921acbe4.zip
env: environments can be named or created in directories
- `spack env create <name>` works as before - `spack env create <path>` now works as well -- environments can be created in their own directories outside of Spack. - `spack install` will look for a `spack.yaml` file in the current directory, and will install the entire project from the environment - The Environment class has been refactored so that it does not depend on the internal Spack environment root; it just takes a path and operates on an environment in that path (so internal and external envs are handled the same) - The named environment interface has been hoisted to the spack.environment module level. - env.yaml is now spack.yaml in all places. It was easier to go with one name for these files than to try to handle logic for both env.yaml and spack.yaml.
Diffstat (limited to 'share')
-rw-r--r--share/spack/csh/spack.csh4
-rwxr-xr-xshare/spack/setup-env.sh5
2 files changed, 5 insertions, 4 deletions
diff --git a/share/spack/csh/spack.csh b/share/spack/csh/spack.csh
index 6690f08eed..a773dd216b 100644
--- a/share/spack/csh/spack.csh
+++ b/share/spack/csh/spack.csh
@@ -77,8 +77,8 @@ case env:
set _sp_env_arg=""
[ $#_sp_args -gt 1 ] && set _sp_env_arg = ($_sp_args[2])
- if ( "$_sp_env_arg" == "" || "$_sp_env_arg" =~ "-*" ) then
- # no args or does not start with -: just execute
+ if ( "$_sp_env_arg" == "" || "$_sp_args" =~ "*--sh*" || "$_sp_args" =~ "*--csh*" || "$_sp_args" =~ "*-h*" ) then
+ # no args or args contain -h/--help, --sh, or --csh: just execute
\spack $_sp_flags env $_sp_args
else
shift _sp_args # consume 'activate' or 'deactivate'
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index af18fcd4e1..79688455bf 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -101,8 +101,9 @@ function spack {
else
case $_sp_arg in
activate)
- if [ -z "$1" -o "${1#-}" != "$1" ]; then
- # no args or does not start with -: just execute
+ _a="$@"
+ if [ -z "$1" -o "${_a#*--sh}" != "$_a" -o "${_a#*--csh}" != "$_a" -o "${_a#*-h}" != "$_a" ]; then
+ # no args or args contain -h/--help, --sh, or --csh: just execute
command spack "${args[@]}"
else
# actual call to activate: source the output