Files
gvm/scripts/pkgset-delete
T
COLDTURNIP f3a0ec1274 Allow managing pkgset under local folder.
While replacing pakcageset name with "--local", the packageset
information will be managed under some/local/repo/.gvm_local folder, and
add the root path of repository as the first path in GOPATH and PATH.
This makes the repository more portable since we don't store all the
go-installed package files under $HOME/.gvm .

The repository root path for gvm is definded as $PWD while
"pkgset create --local" . When "pkgset list" under some configured local
repository, it will list the root path as the first packageset, and
marked with "L".
2013-02-11 02:19:00 +08:00

26 lines
659 B
Bash
Executable File

#!/usr/bin/env bash
. $GVM_ROOT/scripts/functions
[[ $gvm_go_name != "" ]] ||
display_fatal "No Go version selected"
[[ $1 != "" ]] ||
display_fatal "Please specifiy the name"
target_top=$GVM_ROOT
target_set_name=$1
if [[ $1 == "--local" ]]; then
target_top=$(find_local_pkgset)/.gvm_local
target_set_name="local"
fi
[[ -d $target_top/pkgsets/$gvm_go_name/$target_set_name ]] ||
display_fatal "Packageset doesn't exist!"
rm -rf $target_top/pkgsets/$gvm_go_name/$target_set_name ||
display_fatal "Could not delete package set"
rm -rf $target_top/environments/$gvm_go_name@$target_set_name ||
display_fatal "Could not delete package set"