mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-09 12:56:41 +10:00
25 lines
579 B
Plaintext
25 lines
579 B
Plaintext
display_error() {
|
|
tput sgr0
|
|
tput setaf 1
|
|
echo "ERROR: $1" >&2
|
|
tput sgr0
|
|
return 1
|
|
}
|
|
|
|
function gvm_pkgset_use() {
|
|
[[ "$1" != "" ]] ||
|
|
display_error "Please specify a package set" || return 1
|
|
|
|
[[ "$gvm_go_name" != "" ]] ||
|
|
display_error "No Go version selected" || return 1
|
|
|
|
fuzzy_match=`ls $GVM_ROOT/environments | grep "$gvm_go_name@" | grep "$1"` ||
|
|
display_error "Invalid package set" || return 1
|
|
|
|
. "$GVM_ROOT/environments/$gvm_go_name@$1" ||
|
|
display_error "Failed to source the package set environment" || return 1
|
|
|
|
echo "Now using version $fuzzy_match"
|
|
}
|
|
|