mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-10 05:16:13 +10:00
22 lines
456 B
Plaintext
22 lines
456 B
Plaintext
display_error() {
|
|
tput sgr0
|
|
tput setaf 1
|
|
echo "ERROR: $1"
|
|
tput sgr0
|
|
return 1
|
|
}
|
|
|
|
function gvm_pkgset_use() {
|
|
[[ $gvm_go_name != "" ]] ||
|
|
display_error "No Go version selected"
|
|
|
|
fuzzy_match=`ls $GVM_ROOT/environments | grep "$gvm_go_name@" | grep "$1"` ||
|
|
display_error "Invalid package set"
|
|
|
|
. "$GVM_ROOT/environments/$gvm_go_name@$1" ||
|
|
display_error "Failed to source the package set environment"
|
|
|
|
echo "Now using version $fuzzy_match"
|
|
}
|
|
|