Updated install.sh

This commit is contained in:
Caleb Bassi
2018-02-19 18:11:00 -08:00
parent 788580e6a6
commit 8dd8cfac57

View File

@ -2,15 +2,18 @@
VERSION=1.0.0 VERSION=1.0.0
arch=$(uname -sm) print_error() {
echo "No binary found for your architecture. If your architecture is compatible with a binary"
echo "that's already on GitHub, you can manually download and install it and open an issue"
echo "saying so. Otherwise, create an issue requesting binaries to be build for your"
echo "architecture and you can build from source in the meantime if you like."
}
case "$arch" in install() {
Linux\ *64) arch=linux_amd64 ;; curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/gotop-${1}.tgz > /tmp/gotop.tgz
esac tar xf /tmp/gotop.tgz -C /usr/bin
rm /tmp/gotop.tgz
curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/gotop-$arch.tgz > /tmp/gotop.tgz }
tar xf /tmp/gotop.tgz -C /usr/bin
rm /tmp/gotop.tgz
update() { update() {
cur_version=$(gotop -v 2>/dev/null) cur_version=$(gotop -v 2>/dev/null)
@ -21,3 +24,12 @@ update() {
download download
fi fi
} }
arch=$(uname -sm)
case "$arch" in
Linux\ x86_64) install linux_amd64 ;;
*)
print_error
exit 1
;;
esac