Skip to content

Instantly share code, notes, and snippets.

@millsoft
Created March 11, 2020 12:25
Show Gist options
  • Save millsoft/be111e730a7cf2799ab1793cbfbe755b to your computer and use it in GitHub Desktop.
Save millsoft/be111e730a7cf2799ab1793cbfbe755b to your computer and use it in GitHub Desktop.
A script for automatic update of lazygit and lazydocker
#!/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