summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Ainsworth <skainsworth@gmail.com>2021-02-01 04:03:03 -0800
committerGitHub <noreply@github.com>2021-02-01 13:03:03 +0100
commitbbc0f1cbb31ae4c60996063d0db8a9bd1f86e602 (patch)
tree21a3fce5355692afd478adf2071ab8761ed20371
parentaba5be8be2d7bbf67a00b7e8ca0333739d3bc44d (diff)
vscode: fix update script (#110096)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
-rwxr-xr-xpkgs/applications/editors/vscode/update-vscode.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/pkgs/applications/editors/vscode/update-vscode.sh b/pkgs/applications/editors/vscode/update-vscode.sh
index cb1400f048e0..d1ae71cd11e2 100755
--- a/pkgs/applications/editors/vscode/update-vscode.sh
+++ b/pkgs/applications/editors/vscode/update-vscode.sh
@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
-#!nix-shell -i bash -p curl gnugrep gnused gawk
+#!nix-shell -i bash -p curl jq gnused
# Update script for the vscode versions and hashes.
# Usually doesn't need to be called by hand,
@@ -16,8 +16,7 @@ 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}')
+VSCODE_VER=$(curl --fail --silent https://api.github.com/repos/Microsoft/vscode/releases/latest | jq --raw-output .tag_name)
sed -i "s/version = \".*\"/version = \"${VSCODE_VER}\"/" "$ROOT/vscode.nix"
VSCODE_LINUX_URL="https://vscode-update.azurewebsites.net/${VSCODE_VER}/linux-x64/stable"