Last active
May 19, 2020 12:46
-
-
Save ledakis/790a01c7e2b6c00a2d472c824a8eeec4 to your computer and use it in GitHub Desktop.
I have set up my own code-server (https://github.com/cdr/code-server) and the auto update fails, so here is a script to pull the latest x64 release and install it.
This file contains 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
#!/usr/bin/env bash | |
set -e | |
INSTALL_DIR="/usr/lib/code-server/" | |
echo Install dir: $INSTALL_DIR | |
temp_dir=$(mktemp -d) | |
old_dir=$(pwd) | |
cd $temp_dir | |
curl -L --output code-server.tar.gz $(curl -s https://api.github.com/repos/cdr/code-server/releases/latest | jq -r '.assets[] | select(.name|contains("linux-amd64"))| .browser_download_url') | |
tar xzf code-server.tar.gz -C $INSTALL_DIR --strip-components=1 | |
echo Updated, new version: | |
code-server --version | |
cd $old_dir | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works like that. Maybe the curl could have been silent 🤷♂️