Skip to content

Instantly share code, notes, and snippets.

@OneOfOne
Created November 5, 2017 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OneOfOne/77f87c6ed0d7fdf6daf482db18af2eb8 to your computer and use it in GitHub Desktop.
Save OneOfOne/77f87c6ed0d7fdf6daf482db18af2eb8 to your computer and use it in GitHub Desktop.
#!/bin/sh
die() {
echo $1
exit $2
}
if [ "$1" = "update-vsc" ]; then
tmp="/tmp/vscode"
typ="stable"
[ "$2" != "" ] && typ="$2"
pushd /usr/src
rm -rf $tmp
mkdir -p $tmp
echo curl -L https://vscode-update.azurewebsites.net/latest/linux-x64/$typ
curl -L https://vscode-update.azurewebsites.net/latest/linux-x64/$typ | tar -vxzC $tmp || exit 1
rm -rf VSCode-linux-x64.previous &>/dev/null
mv VSCode-linux-x64 VSCode-linux-x64.previous &>/dev/null
mv $tmp/VSCode-linux-x64 .
exit 0
fi
if [ -x /usr/src/VSCode-linux-x64/bin/code-insiders ]; then
exec /usr/src/VSCode-linux-x64/bin/code-insiders $@
else
exec /usr/src/VSCode-linux-x64/bin/code $@
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment