mirror of
https://github.com/wahyd4/gvm.git
synced 2026-08-09 04:46:19 +10:00
24 lines
851 B
Bash
Executable File
24 lines
851 B
Bash
Executable File
#!/bin/bash
|
|
. $GVM_ROOT/scripts/functions
|
|
LS_PATH=`which ls` || display_error "$LS_ERROR" || return 1
|
|
|
|
[[ "$1" == "" ]] &&
|
|
display_error "Please specifiy the version"
|
|
|
|
fuzzy_match=`$LS_PATH $GVM_ROOT/gos | sort | grep "$1" | head -n 1 | grep "$1"` ||
|
|
display_error "Invalid version $1"
|
|
|
|
if [ -d $GVM_ROOT/gos/$fuzzy_match ]; then
|
|
rm -rf $GVM_ROOT/pkgsets/$fuzzy_match &> /dev/null ||
|
|
display_error "Couldn't remove pkgsets"
|
|
rm -f $GVM_ROOT/environments/$fuzzy_match &> /dev/null ||
|
|
display_error "Couldn't remove environment files"
|
|
rm -f "$GVM_ROOT/environments/$fuzzy_match@"* &> /dev/null ||
|
|
display_error "Couldn't remove pkgset environment files"
|
|
rm -rf $GVM_ROOT/gos/$fuzzy_match &> /dev/null ||
|
|
display_error "Couldn't remove Go folder"
|
|
display_message "Uninstalled version $fuzzy_match"
|
|
else
|
|
display_error "Invalid version"
|
|
fi
|