Last active
June 15, 2016 09:09
-
-
Save uetchy/b285401a11134d6c3688945b1037cd81 to your computer and use it in GitHub Desktop.
nv Install Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
GOOWNER=uetchy | |
GONAME=nv | |
GOTAG=v2.0.0 | |
if [[ `uname -s` =~ ([Dd]arwin|mac os x) ]]; then | |
GOOS="darwin" | |
GOEXT="" | |
elif [ `uname -s` = 'windows' ]; then | |
GOOS="windows" | |
GOEXT=".exe" | |
else | |
GOOS="linux" | |
GOEXT="" | |
fi | |
if [[ `uname -m` =~ (x86_64|amd64) ]]; then | |
GOARCH="amd64" | |
else | |
GOARCH="386" | |
fi | |
GOTARGETURL=https://github.com/${GOOWNER}/${GONAME}/releases/download/${GOTAG}/${GONAME}_${GOOS}_${GOARCH}${GOEXT} | |
echo Downloading $GOTARGETURL | |
curl -L $GOTARGETURL > /usr/local/bin/${GONAME} && chmod +x /usr/local/bin/${GONAME} | |
echo Successfully installed: /usr/local/bin/${GONAME} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment