From: Felix Fietkau Date: Wed, 27 Aug 2008 14:13:47 +0000 (+0000) Subject: fix ./scripts/env delete X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c714cb75102dcb4c52454db22d1a0269a9e07897;p=openwrt%2Fsvn-archive%2Farchive.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" }