diff options
| author | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2026-06-06 12:27:03 -0400 |
|---|---|---|
| committer | Douglas B. Rumbaugh <doug@douglasrumbaugh.com> | 2026-06-06 12:27:03 -0400 |
| commit | 0ecfe53b2d271133fac36de11ecfc0f7e47840f0 (patch) | |
| tree | 3ee8b5188936e350e15ff851b07a33031d366389 /ves-deactivate.sh | |
| parent | 04b385284a8559bde3df51bab950784a0fd28cfd (diff) | |
| download | sh-ves-0ecfe53b2d271133fac36de11ecfc0f7e47840f0.tar.gz | |
Initial version complete
I dusted this off after years and had Claude finish
it for me.
caveat emptor: this is largely (though not entirely)
LLM generated as of this commit
Diffstat (limited to 'ves-deactivate.sh')
| -rwxr-xr-x[-rw-r--r--] | ves-deactivate.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ves-deactivate.sh b/ves-deactivate.sh index 1a24852..3937f93 100644..100755 --- a/ves-deactivate.sh +++ b/ves-deactivate.sh @@ -1 +1,20 @@ #!/bin/sh +# +# Deactivate the currently active sh-ves environment, restoring all +# overridden variables to the values saved by ves_activate. +# +ves_deactivate() { + if [ -z "$SHVES_ENV_NM" ]; then + printf "ERROR: No environment is currently active.\n" >&2 + return 1 + fi + + for var in $SHVES_SAVED_VARS; do + _shves_restore_var "$var" + done + + unset SHVES_SAVED_VARS + unset SHVES_ENV_NM + + return 0 +} |