Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,38 @@ To install:

Or if you are using zsh just change `bash` with `zsh`

Installing from source
======================

The installer clones a repository, so it can install any fork or branch. Point
`SRC_REPO` at the repository and pass the branch or tag as the first argument
(it defaults to `master`):

```
SRC_REPO=https://github.com/danish-a1/gvm.git \
bash < <(curl -s -S -L https://raw.githubusercontent.com/danish-a1/gvm/master/binscripts/gvm-installer) master
```

To install from a clone you already have, run the installer from inside it —
it copies the working tree instead of cloning:

```
git clone https://github.com/danish-a1/gvm.git
cd gvm
./binscripts/gvm-installer
```

The installer refuses to overwrite an existing install, so remove the old one
first and open a new shell afterwards:

```
rm -rf ~/.gvm
```

Your Go versions live in `~/.gvm/gos` and are deleted with it. To keep them,
move the directory aside and move `gos`, `pkgsets` and `environments` back
after installing.

Installing Go
=============
gvm install go1.4
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.22
1.0.23
1 change: 1 addition & 0 deletions scripts/env/pkgset-use
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

. "$GVM_ROOT/scripts/functions" || return 1
. "$GVM_ROOT/scripts/function/_bash_pseudo_hash" || return 1
. "$GVM_ROOT/scripts/function/_shell_compat" || return 1

Expand Down
1 change: 1 addition & 0 deletions scripts/env/use
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash

. "$GVM_ROOT/scripts/functions" || return 1
. "$GVM_ROOT/scripts/function/_bash_pseudo_hash" || return 1
. "$GVM_ROOT/scripts/function/_shell_compat" || return 1

Expand Down
2 changes: 1 addition & 1 deletion scripts/function/_bash_pseudo_hash
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ _encode() {
new_string+="$__char"
;;
*)
hex="$(echo -n "$__char" | $HEXDUMP_PATH -e '1 1 "!%02x"')"
hex="$(echo -n "$__char" | ${HEXDUMP_PATH:-hexdump} -e '1 1 "!%02x"')"
new_string+="${hex//!/%}"
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion scripts/function/gvm_environment_sanitize
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function gvm_environment_sanitize() {
if [[ "${ACTIVE_GO/${GOROOT}}" != "/bin/go" ]]; then
OLD_GOROOT="$GOROOT" && unset GOROOT
GOROOT="$(go env GOROOT)"
$SED_PATH -i'' -e 's|'${OLD_GOROOT}'|'${GOROOT}'|g' "$GVM_ROOT/environments/$1"
${SED_PATH:-sed} -i'' -e 's|'${OLD_GOROOT}'|'${GOROOT}'|g' "$GVM_ROOT/environments/$1"
. "$GVM_ROOT/environments/$1" &> /dev/null
fi
}
2 changes: 1 addition & 1 deletion scripts/function/gvm_export_path
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
function gvm_export_path() {
export PATH="$GVM_ROOT/bin:$(echo "$PATH" | $TR_PATH ":" "\n" | "$GREP_PATH" -v '^$' | $EGREP_PATH -v "$GVM_ROOT/(pkgsets|gos|bin)" | $TR_PATH "\n" ":" | $SED_PATH 's/:*$//')"
export PATH="$GVM_ROOT/bin:$(echo "$PATH" | ${TR_PATH:-tr} ":" "\n" | "${GREP_PATH:-grep}" -v '^$' | ${EGREP_PATH:-egrep} -v "$GVM_ROOT/(pkgsets|gos|bin)" | ${TR_PATH:-tr} "\n" ":" | ${SED_PATH:-sed} 's/:*$//')"
export GVM_PATH_BACKUP="$PATH"
}

2 changes: 1 addition & 1 deletion scripts/templates/binary
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
. "$GVM_ROOT/scripts/functions/tools"
. "$GVM_ROOT/scripts/function/tools"
echo "$1" | sed -n -e '/_.*_/ p' | $GREP_PATH "_" &> /dev/null
if [ "$?" == "0" ]; then
version=$(echo $1 | sed 's/_\(.*\)_/\1/')
Expand Down