summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/env5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/env b/scripts/env
index a1211fbde..1aee4b323 100755
--- a/scripts/env
+++ b/scripts/env
@@ -148,10 +148,11 @@ env_clear() {
env_delete() {
local name="${1##*/}"
+ env_init
[ -z "$name" ] && usage
- [ -f "$envdir/.git/refs/heads/$name" ] || error "environment '$name' not found"
+ [ -f "$ENVDIR/.git/refs/heads/$name" ] || error "environment '$name' not found"
branch="$(git branch | grep '^\* ' | awk '{print $2}')"
- [ "$name" = "branch" ] && error "cannot delete the currently selected environment"
+ [ "$name" = "$branch" ] && error "cannot delete the currently selected environment"
git branch -D "$name"
}