You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.0 KiB
Bash
41 lines
1.0 KiB
Bash
#!/usr/bin/env bash
|
|
. "$GVM_ROOT/scripts/functions" || return 1
|
|
|
|
function gvm() {
|
|
if [[ "$GVM_ROOT" == "" ]]; then
|
|
display_error "GVM_ROOT not set. Please source \$GVM_ROOT/scripts/gvm"
|
|
return $?
|
|
fi
|
|
if [[ -d $GVM_ROOT/.git ]]; then
|
|
mv "$GVM_ROOT/.git" "$GVM_ROOT/git.bak" ||
|
|
display_error "Failed to move git info out of the way"
|
|
fi
|
|
if [[ ! -d $GVM_ROOT ]]; then
|
|
display_error "GVM_ROOT does not exist. Please reinstall GVM"
|
|
return $?
|
|
fi
|
|
|
|
mkdir -p "$GVM_ROOT/logs" > /dev/null 2>&1
|
|
mkdir -p "$GVM_ROOT/gos" > /dev/null 2>&1
|
|
mkdir -p "$GVM_ROOT/archive" > /dev/null 2>&1
|
|
mkdir -p "$GVM_ROOT/archive/package" > /dev/null 2>&1
|
|
mkdir -p "$GVM_ROOT/environments" > /dev/null 2>&1
|
|
|
|
if [[ "$1" == "use" ]]; then
|
|
. "$GVM_ROOT/scripts/env/use"
|
|
shift
|
|
gvm_use "$@"
|
|
elif [[ "$1" == "implode" ]]; then
|
|
. "$GVM_ROOT/scripts/env/implode"
|
|
gvm_implode
|
|
elif [[ "$1" == "pkgset" ]] && [[ "$2" == "use" ]]; then
|
|
. "$GVM_ROOT/scripts/env/pkgset-use"
|
|
shift
|
|
shift
|
|
gvm_pkgset_use "$@"
|
|
else
|
|
"$GVM_ROOT/bin/gvm" "$@"
|
|
fi
|
|
}
|
|
|