forked from mirrors/nixpkgs
1692e2cbb5
Split up the vscode update.sh into separate vscode/vscodium update scripts. Recently the versions of vscode and vscodium have diverged (see VSCodium/vscodium#501), meaning that the updates for one package fail while the other succeeds. This PR splits up the update scripts so that one can be run with out the other and vice-versa.
25 lines
1.1 KiB
Bash
25 lines
1.1 KiB
Bash
#!/usr/bin/env nix-shell
|
|
#!nix-shell -i bash -p curl gnugrep gnused gawk
|
|
|
|
set -eou pipefail
|
|
|
|
ROOT="$(dirname "$(readlink -f "$0")")"
|
|
if [ ! -f "$ROOT/vscode.nix" ]; then
|
|
echo "ERROR: cannot find vscode.nix in $ROOT"
|
|
exit 1
|
|
fi
|
|
|
|
# VSCode
|
|
|
|
VSCODE_VER=$(curl -s -L "https://code.visualstudio.com/Download" | grep "is now available" | awk -F'</span>' '{print $1}' | awk -F'>' '{print $NF}')
|
|
VSCODE_VER=$(curl -s -L "https://code.visualstudio.com/updates/v${VSCODE_VER/./_}" | grep "Downloads:" | awk -F'code.visualstudio.com/' '{print $2}' | awk -F'/' '{print $1}')
|
|
sed -i "s/version = \".*\"/version = \"${VSCODE_VER}\"/" "$ROOT/vscode.nix"
|
|
|
|
VSCODE_LINUX_URL="https://vscode-update.azurewebsites.net/${VSCODE_VER}/linux-x64/stable"
|
|
VSCODE_LINUX_SHA256=$(nix-prefetch-url ${VSCODE_LINUX_URL})
|
|
sed -i "s/x86_64-linux = \".\{52\}\"/x86_64-linux = \"${VSCODE_LINUX_SHA256}\"/" "$ROOT/vscode.nix"
|
|
|
|
VSCODE_DARWIN_URL="https://vscode-update.azurewebsites.net/${VSCODE_VER}/darwin/stable"
|
|
VSCODE_DARWIN_SHA256=$(nix-prefetch-url ${VSCODE_DARWIN_URL})
|
|
sed -i "s/x86_64-darwin = \".\{52\}\"/x86_64-darwin = \"${VSCODE_DARWIN_SHA256}\"/" "$ROOT/vscode.nix"
|