github.com/NeowayLabs/nash@v0.2.2-0.20200127205349-a227041ffd50/hack/install/unix.sh (about) 1 #!/bin/bash 2 3 set -o errexit 4 set -o nounset 5 set -o pipefail 6 7 which wget >/dev/null || { echo "wget not installed"; exit 1; } 8 which tar >/dev/null || { echo "tar not installed"; exit 1; } 9 which tr >/dev/null || { echo "tr not found"; exit 1; } 10 11 NASHROOT=${NASHROOT:-$HOME/nashroot} 12 VERSION="v1.1" 13 ARCH="amd64" 14 OS="$(uname | tr '[:upper:]' '[:lower:]')" 15 16 if [ $# -eq 1 ]; then 17 VERSION=$1 18 fi 19 20 echo "installing nash (${OS}): ${VERSION} at NASHROOT: ${NASHROOT}" 21 22 mkdir -p $NASHROOT 23 cd $NASHROOT 24 tarfile="nash-${VERSION}-${OS}-${ARCH}.tar.gz" 25 wget -c https://github.com/madlambda/nash/releases/download/$VERSION/$tarfile 26 tar xvfz $tarfile 27 rm -f $tarfile