fix ./scripts/env delete
authorFelix Fietkau <nbd@openwrt.org>
Wed, 27 Aug 2008 14:13:47 +0000 (14:13 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 27 Aug 2008 14:13:47 +0000 (14:13 +0000)
SVN-Revision: 12399

scripts/env

index a1211fbde04933dbd2a1e4fb6389396ac5e1b26f..1aee4b323b82b7565ef867aba36cb57152aa4b71 100755 (executable)
@@ -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"
 }