summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-02-15 16:21:19 +0100
committerMassimiliano Culpo <massimiliano.culpo@gmail.com>2022-04-14 11:08:17 +0200
commit5b0d4fe928a6cab7257b8949a0be4b61d6d1951a (patch)
tree9efe5b45cadbcb6451655217919341c66b02d5b1 /lib
parentdeb9102b2dd671871b1362b1d20a719fef077f0d (diff)
downloadspack-5b0d4fe928a6cab7257b8949a0be4b61d6d1951a.tar.gz
spack-5b0d4fe928a6cab7257b8949a0be4b61d6d1951a.tar.bz2
spack-5b0d4fe928a6cab7257b8949a0be4b61d6d1951a.tar.xz
spack-5b0d4fe928a6cab7257b8949a0be4b61d6d1951a.zip
Unalias despacktivate only when alias exists (#28939)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/environment/shell.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/spack/spack/environment/shell.py b/lib/spack/spack/environment/shell.py
index abc537cdf2..33825c00d3 100644
--- a/lib/spack/spack/environment/shell.py
+++ b/lib/spack/spack/environment/shell.py
@@ -73,7 +73,7 @@ def deactivate_header(shell):
cmds += 'if [ ! -z ${SPACK_ENV+x} ]; then\n'
cmds += 'unset SPACK_ENV; export SPACK_ENV;\n'
cmds += 'fi;\n'
- cmds += 'unalias despacktivate;\n'
+ cmds += 'alias despacktivate > /dev/null 2>&1 && unalias despacktivate;\n'
cmds += 'if [ ! -z ${SPACK_OLD_PS1+x} ]; then\n'
cmds += ' if [ "$SPACK_OLD_PS1" = \'$$$$\' ]; then\n'
cmds += ' unset PS1; export PS1;\n'