mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-10 05:16:13 +10:00
23 lines
502 B
Plaintext
23 lines
502 B
Plaintext
function display_error() {
|
|
tput sgr0
|
|
tput setaf 1
|
|
echo "ERROR: $1" >&2
|
|
tput sgr0
|
|
return 1
|
|
}
|
|
|
|
function gvm_use() {
|
|
[[ "$1" != "" ]] ||
|
|
display_error "Please specifiy the version" || return 1
|
|
fuzzy_match=`ls $GVM_ROOT/gos | grep "$1" | head -n 1` ||
|
|
display_error "Invalid version $1" || return 1
|
|
|
|
. $GVM_ROOT/environments/$fuzzy_match
|
|
if [[ "$2" == "--default" ]]; then
|
|
cp $GVM_ROOT/environments/$fuzzy_match $GVM_ROOT/environments/default
|
|
fi
|
|
|
|
echo "Now using version $fuzzy_match"
|
|
}
|
|
|