devnw / gvm

Go Version Manager (gvm) enables seamless installing and swapping between Go versions with a single command. This tool manages a Go environment for the user by allowing a user to specify which Go version they wish to use and handling all of the steps to install and configure that Go version. GVM also supports installing Go from the official Golang master branch so that you can easily try the next version of Go without waiting for a pre release build.
Apache License 2.0
55 stars 4 forks source link

Test on Windows WSL 2 #11

Open benjivesterby opened 2 years ago

benjivesterby commented 2 years ago

Determine if this runs properly on WSL 2 running ubuntu.

Correct issues if it doesn't and update documentation to list as supported.

madewithsalt commented 2 years ago

In order for this to work, the $PATH needs to be updated in the .profile in root, instead of .bashrc.

Here's a sample of my .profile from a fresh install of Ubuntu on WSL2:

# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
    . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

export PATH="/home/kcent/.gvm/go/bin:$PATH"