aboutsummaryrefslogtreecommitdiffstats
path: root/ves-delete.sh
diff options
context:
space:
mode:
authorDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2026-06-06 12:27:03 -0400
committerDouglas B. Rumbaugh <doug@douglasrumbaugh.com>2026-06-06 12:27:03 -0400
commit0ecfe53b2d271133fac36de11ecfc0f7e47840f0 (patch)
tree3ee8b5188936e350e15ff851b07a33031d366389 /ves-delete.sh
parent04b385284a8559bde3df51bab950784a0fd28cfd (diff)
downloadsh-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-delete.sh')
-rwxr-xr-x[-rw-r--r--]ves-delete.sh15
1 files changed, 12 insertions, 3 deletions
diff --git a/ves-delete.sh b/ves-delete.sh
index 6d1557b..648677d 100644..100755
--- a/ves-delete.sh
+++ b/ves-delete.sh
@@ -1,7 +1,11 @@
#!/bin/sh
+#
+# Delete an existing sh-ves environment. The active environment may not
+# be deleted; deactivate it first.
+#
ves_delete() {
if [ "$#" -lt 1 ]; then
- printf "ERROR: No environment name specified.\n" > /dev/stderr
+ printf "ERROR: No environment name specified.\n" >&2
return 1
fi
@@ -11,11 +15,16 @@ ves_delete() {
fi
if ! _shves_check_env_exists "$env_name"; then
- return 1;
+ return 1
+ fi
+
+ if [ "$env_name" = "$SHVES_ENV_NM" ]; then
+ printf "ERROR: Environment [%s] is currently active. Deactivate it first.\n" "$env_name" >&2
+ return 1
fi
rm -f "$SHVES_ENV_DIR/$env_name"
- printf "Environment [%s] deleted successfully\n" $env_name
+ printf "Environment [%s] deleted successfully\n" "$env_name"
return 0
}