summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2023-10-31 22:27:00 +0100
committerGitHub <noreply@github.com>2023-10-31 22:27:00 +0100
commit343ed8a3faa9927045a26b9b569a261811e61716 (patch)
treec96d7065ad20785ff0c7e633f4d0f4ea189850dc /share
parent58e531508928a931925cc8166fe49fed63bc674f (diff)
downloadspack-343ed8a3faa9927045a26b9b569a261811e61716.tar.gz
spack-343ed8a3faa9927045a26b9b569a261811e61716.tar.bz2
spack-343ed8a3faa9927045a26b9b569a261811e61716.tar.xz
spack-343ed8a3faa9927045a26b9b569a261811e61716.zip
force color in subshell if not SPACK_COLOR (#40782)
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/setup-env.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index b5f4348635..91a601e652 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -98,7 +98,7 @@ _spack_shell_wrapper() {
if [ "$_sp_arg" = "-h" ] || [ "$_sp_arg" = "--help" ]; then
command spack cd -h
else
- LOC="$(spack location $_sp_arg "$@")"
+ LOC="$(SPACK_COLOR="${SPACK_COLOR:-always}" spack location $_sp_arg "$@")"
if [ -d "$LOC" ] ; then
cd "$LOC"
else
@@ -136,7 +136,7 @@ _spack_shell_wrapper() {
command spack env activate "$@"
else
# Actual call to activate: source the output.
- stdout="$(command spack $_sp_flags env activate --sh "$@")" || return
+ stdout="$(SPACK_COLOR="${SPACK_COLOR:-always}" command spack $_sp_flags env activate --sh "$@")" || return
eval "$stdout"
fi
;;
@@ -158,7 +158,7 @@ _spack_shell_wrapper() {
command spack env deactivate -h
else
# No args: source the output of the command.
- stdout="$(command spack $_sp_flags env deactivate --sh)" || return
+ stdout="$(SPACK_COLOR="${SPACK_COLOR:-always}" command spack $_sp_flags env deactivate --sh)" || return
eval "$stdout"
fi
;;
@@ -186,7 +186,7 @@ _spack_shell_wrapper() {
# Args contain --sh, --csh, or -h/--help: just execute.
command spack $_sp_flags $_sp_subcommand "$@"
else
- stdout="$(command spack $_sp_flags $_sp_subcommand --sh "$@")" || return
+ stdout="$(SPACK_COLOR="${SPACK_COLOR:-always}" command spack $_sp_flags $_sp_subcommand --sh "$@")" || return
eval "$stdout"
fi
;;