Skip to content

Instantly share code, notes, and snippets.

@uetchy
Last active June 15, 2016 09:09
Show Gist options
  • Save uetchy/b285401a11134d6c3688945b1037cd81 to your computer and use it in GitHub Desktop.
Save uetchy/b285401a11134d6c3688945b1037cd81 to your computer and use it in GitHub Desktop.
nv Install Script
#!/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