Moved uninstall to new file
This commit is contained in:
parent
bf138746d8
commit
0cd4c221d0
|
@ -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
|
||||
|
|
41
install.sh
41
install.sh
|
@ -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
3
uninstall.sh
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
rm /usr/bin/gotop 2>/dev/null
|
Loading…
Reference in New Issue
Block a user