Moved uninstall to new file

This commit is contained in:
Caleb Bassi 2018-02-19 11:30:38 -08:00
parent bf138746d8
commit 0cd4c221d0
3 changed files with 18 additions and 34 deletions

View File

@ -13,12 +13,16 @@ Go code compiles to a single executable so you just need to somehow get that int
Either manually download the latest release for your OS from the releases tab and move it into `/usr/bin`, or run this command to do it for you:
```
curl https://raw.githubusercontent.com/cjbassi/gotop/master/install.sh | sudo sh
curl https://raw.githubusercontent.com/cjbassi/gotop/master/install.sh | sudo bash
```
If you install this way, starting gotop with the `-u` flag or pressing `u` in gotop will check to see if there is a newer version available and automatically update if so.
Windows is currently untested/unsupported but PR's for fixing that are welcome.
To uninstall, run:
```
curl https://raw.githubusercontent.com/cjbassi/gotop/master/uninstall.sh | sudo bash
```
### Arch Linux

View File

@ -1,15 +1,15 @@
#!/bin/bash
#!/usr/bin/env bash
VERSION=1.0.0
download() {
arch=$(uname -sm)
case "$arch" in
Linux\ *64) exe=gotop-linux_amd64 ;;
esac
curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/$exe > /usr/bin/gotop
chmod +x /usr/bin/gotop
}
arch=$(uname -sm)
case "$arch" in
Linux\ *64) exe=linux_amd64 ;;
esac
curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/gotop-$exe > /usr/bin/gotop
chmod +x /usr/bin/gotop
update() {
cur_version=$(gotop -v 2>/dev/null)
@ -20,26 +20,3 @@ update() {
download
fi
}
uninstall() {
rm /usr/bin/gotop 2>/dev/null
}
for opt in "$@"; do
case $opt in
--uninstall)
uninstall
exit 0
;;
--update)
update
exit 0
;;
*)
echo "unknown option: $opt"
exit 1
;;
esac
done
download

3
uninstall.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
rm /usr/bin/gotop 2>/dev/null