From d2ecb1cef6a0c3bc549f1fcae20efc4fb16ad7c9 Mon Sep 17 00:00:00 2001 From: Caleb Bassi Date: Thu, 22 Feb 2018 14:42:26 -0800 Subject: [PATCH] install.sh doesn't copy to /usr/bin anymore --- README.md | 18 ++++++++---------- install.sh | 25 ++++--------------------- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 138ed6d..76c3458 100644 --- a/README.md +++ b/README.md @@ -12,15 +12,14 @@ Built with [gopsutil](https://github.com/shirou/gopsutil), [drawille-go](https:/ Binaries are currently available for 32/64bit Linux and 64bit OSX. -To download the latest binary for your OS into `/usr/bin`, you can run the [install](https://github.com/cjbassi/gotop/blob/master/install.sh) script: +To download the latest binary for your system from GitHub, you can run the [install](https://github.com/cjbassi/gotop/blob/master/install.sh) script: - curl https://raw.githubusercontent.com/cjbassi/gotop/master/install.sh | sudo bash +``` +curl https://raw.githubusercontent.com/cjbassi/gotop/master/install.sh | bash +``` -If you install this way, starting gotop with the `-u` flag will update if there's a newer version. +Then move `gotop` somewhere into your $PATH. -To uninstall: - - sudo rm /usr/bin/gotop ### Arch Linux @@ -28,7 +27,9 @@ Alternatively, if you're on Arch Linux you can install the `gotop` package from ### Source - go get github.com/cjbassi/gotop +``` +go get github.com/cjbassi/gotop +``` ## Usage @@ -49,7 +50,6 @@ Alternatively, if you're on Arch Linux you can install the `gotop` package from * `dd`: kill the selected process or process group * ``/`` and `h`/`l`: zoom in and out of graphs * `?`: toggles keybind help menu -* `u`: update gotop ### Mouse @@ -71,9 +71,7 @@ Feel free to add a new one. You can use 256 colors, bold, underline, and reverse * Process List - memory total goes above 100% * general - - more themes - command line option to set polling interval for CPU and mem - - command line updating - command line option to only show processes, CPU, and mem - zooming in and out of graphs - gopsutil issue for darwin i386 diff --git a/install.sh b/install.sh index 2825e08..f830e9f 100755 --- a/install.sh +++ b/install.sh @@ -2,27 +2,10 @@ VERSION=1.0.1 -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." -} - install() { - curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/gotop-$VERSION-${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) - if [[ $? != 0 ]]; then - download - fi - if (( "${cur_version//.}" < "${VERSION//.}" )); then - download - fi + curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/gotop-$VERSION-${1}.tgz > gotop.tgz + tar xf gotop.tgz + rm gotop.tgz } arch=$(uname -sm) @@ -31,7 +14,7 @@ case "$arch" in Linux\ *86) install linux_386 ;; Darwin\ *64) install darwin_amd64 ;; *) - print_error + echo "No binary found for your system" exit 1 ;; esac