From: Felix Fietkau Date: Wed, 27 Aug 2008 14:13:47 +0000 (+0000) Subject: fix ./scripts/env delete X-Git-Tag: v19.07.0-rc1~36360 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1063f8d415b283779cc459b6c0fbfb91810c83f2;p=openwrt%2Fstaging%2Fhauke.git fix ./scripts/env delete SVN-Revision: 12399 --- diff --git a/scripts/env b/scripts/env index a1211fbde0..1aee4b323b 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" }