diff options
author | Caleb Bassi <calebjbassi@gmail.com> | 2018-02-19 18:11:00 -0800 |
---|---|---|
committer | Caleb Bassi <calebjbassi@gmail.com> | 2018-02-19 18:11:00 -0800 |
commit | 8dd8cfac5786e579a082e14e5077623d16711dc6 (patch) | |
tree | 18535571f67cd570e97da975df530f7d38038a30 | |
parent | 788580e6a6bfe807c05ae143fa4320e7e1b47d2c (diff) |
Updated install.sh
-rwxr-xr-x | install.sh | 28 |
1 files changed, 20 insertions, 8 deletions
@@ -2,15 +2,18 @@ VERSION=1.0.0 -arch=$(uname -sm) - -case "$arch" in - Linux\ *64) arch=linux_amd64 ;; -esac +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." +} -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 +install() { + curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/gotop-${1}.tgz > /tmp/gotop.tgz + tar xf /tmp/gotop.tgz -C /usr/bin + rm /tmp/gotop.tgz +} update() { cur_version=$(gotop -v 2>/dev/null) @@ -21,3 +24,12 @@ update() { download fi } + +arch=$(uname -sm) +case "$arch" in + Linux\ x86_64) install linux_amd64 ;; + *) + print_error + exit 1 + ;; +esac |