Created
March 11, 2020 12:25
-
-
Save millsoft/be111e730a7cf2799ab1793cbfbe755b to your computer and use it in GitHub Desktop.
A script for automatic update of lazygit and lazydocker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# a script for updating lazygit and lazydocker | |
# it downloads the newest release and replaces the installed version | |
download() { | |
curl -s https://api.github.com/repos/jesseduffield/${APP}/releases/latest | grep "browser_download_url.*Linux.*x86_64.*gz\"" | cut -d : -f 2,3 | tr -d \" | wget -qi - | |
} | |
extract() { | |
tar -zxvf *.tar.gz $APP | |
rm *.tar.gz | |
} | |
install(){ | |
echo "**** UPDATING $APP ****" | |
$APP --version | |
FULL_APP_PATH=`whereis $APP | cut -d" " -f 2` | |
APP_PATH=`dirname $FULL_APP_PATH` | |
mv $APP $APP_PATH | |
$APP --version | |
} | |
APP=lazygit | |
download | |
extract | |
install | |
APP=lazydocker | |
download | |
extract | |
install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment