From 5b0d4fe928a6cab7257b8949a0be4b61d6d1951a Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Tue, 15 Feb 2022 16:21:19 +0100 Subject: Unalias despacktivate only when alias exists (#28939) --- lib/spack/spack/environment/shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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' -- cgit v1.2.3-70-g09d2