gvm root
This commit is contained in:
parent
ace9bf07c3
commit
9780201e97
|
@ -2638,12 +2638,16 @@ function create_mirrors {
|
|||
}
|
||||
|
||||
function select_go_version {
|
||||
if [ ! -d $HOME/.gvm/scripts ]; then
|
||||
if [ ! -d $HOME/.gvm/bin ]; then
|
||||
echo $'GVM was not installed'
|
||||
exit 629532
|
||||
fi
|
||||
cd $HOME/.gvm/scripts
|
||||
gvm use go${GO_VERSION} --default
|
||||
export GVM_ROOT=$HOME/.gvm
|
||||
if ! grep -q "GVM_ROOT=" ~/.bashrc; then
|
||||
echo "export GVM_ROOT=$GVM_ROOT" >> ~/.bashrc
|
||||
fi
|
||||
cd $GVM_ROOT/bin
|
||||
./gvm use go${GO_VERSION} --default
|
||||
systemctl set-environment GOPATH=$GOPATH
|
||||
|
||||
if [ ${#GOPATH} -lt 2 ]; then
|
||||
|
@ -6318,19 +6322,24 @@ function upgrade_golang {
|
|||
# and contains hardcoded github. See if you can do better
|
||||
./binscripts/gvm-installer
|
||||
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
|
||||
if [ ! -f $HOME/.gvm/scripts/gvm ]; then
|
||||
if [ ! -f $HOME/.gvm/bin/gvm ]; then
|
||||
echo $'gvm was not installed'
|
||||
fi
|
||||
cd $HOME/.gvm/scripts
|
||||
gvm install go1.4
|
||||
gvm use go1.4
|
||||
export GVM_ROOT=$HOME/.gvm
|
||||
if ! grep -q "GVM_ROOT=" ~/.bashrc; then
|
||||
echo 'export GVM_ROOT=$HOME/.gvm' >> ~/.bashrc
|
||||
fi
|
||||
|
||||
cd $GVM_ROOT/bin
|
||||
./gvm install go1.4
|
||||
./gvm use go1.4
|
||||
export GOROOT_BOOTSTRAP=$GOROOT
|
||||
gvm install go${GO_VERSION}
|
||||
./gvm install go${GO_VERSION}
|
||||
if [ ! "$?" = "0" ]; then
|
||||
echo $'Unable to upgrade golang'
|
||||
exit 529252
|
||||
fi
|
||||
gvm use go${GO_VERSION} --default
|
||||
./gvm use go${GO_VERSION} --default
|
||||
|
||||
if ! grep -q "gvm commit" $COMPLETION_FILE; then
|
||||
echo "gvm commit:$GVM_COMMIT" >> $COMPLETION_FILE
|
||||
|
|
|
@ -377,9 +377,10 @@ function backup_users {
|
|||
}
|
||||
|
||||
function backup_directories {
|
||||
if [ -d $HOME/.gvm/scripts ]; then
|
||||
cd $HOME/.gvm/scripts
|
||||
gvm use go${GO_VERSION} --default
|
||||
export GVM_ROOT=$HOME/.gvm
|
||||
if [ -d $GVM_ROOT/bin ]; then
|
||||
cd $GVM_ROOT/bin
|
||||
./gvm use go${GO_VERSION} --default
|
||||
systemctl set-environment GOPATH=$GOPATH
|
||||
fi
|
||||
|
||||
|
@ -464,9 +465,10 @@ function remove_backup_directory {
|
|||
}
|
||||
|
||||
function prepare_directories {
|
||||
if [ -d $HOME/.gvm/scripts ]; then
|
||||
cd $HOME/.gvm/scripts
|
||||
gvm use go${GO_VERSION} --default
|
||||
export GVM_ROOT=$HOME/.gvm
|
||||
if [ -d $GVM_ROOT/bin ]; then
|
||||
cd $GVM_ROOT/bin
|
||||
./gvm use go${GO_VERSION} --default
|
||||
systemctl set-environment GOPATH=$GOPATH
|
||||
fi
|
||||
|
||||
|
|
|
@ -374,9 +374,10 @@ function backup_mediagoblin {
|
|||
}
|
||||
|
||||
function backup_gogs {
|
||||
if [ -d $HOME/.gvm/scripts ]; then
|
||||
cd $HOME/.gvm/scripts
|
||||
gvm use go${GO_VERSION} --default
|
||||
export GVM_ROOT=$HOME/.gvm
|
||||
if [ -d $GVM_ROOT/bin ]; then
|
||||
cd $GVM_ROOT/bin
|
||||
./gvm use go${GO_VERSION} --default
|
||||
systemctl set-environment GOPATH=$GOPATH
|
||||
fi
|
||||
|
||||
|
|
|
@ -929,9 +929,10 @@ function restore_mediagoblin {
|
|||
}
|
||||
|
||||
function restore_gogs {
|
||||
if [ -d $HOME/.gvm/scripts ]; then
|
||||
cd $HOME/.gvm/scripts
|
||||
gvm use go${GO_VERSION} --default
|
||||
export GVM_ROOT=$HOME/.gvm
|
||||
if [ -d $GVM_ROOT/bin ]; then
|
||||
cd $GVM_ROOT/bin
|
||||
./gvm use go${GO_VERSION} --default
|
||||
systemctl set-environment GOPATH=$GOPATH
|
||||
fi
|
||||
|
||||
|
|
|
@ -798,9 +798,10 @@ function restore_mediagoblin {
|
|||
}
|
||||
|
||||
function restore_gogs {
|
||||
if [ -d $HOME/.gvm/scripts ]; then
|
||||
cd $HOME/.gvm/scripts
|
||||
gvm use go${GO_VERSION} --default
|
||||
export GVM_ROOT=$HOME/.gvm
|
||||
if [ -d $GVM_ROOT/bin ]; then
|
||||
cd $GVM_ROOT/bin
|
||||
./gvm use go${GO_VERSION} --default
|
||||
systemctl set-environment GOPATH=$GOPATH
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue