From bbc0f1cbb31ae4c60996063d0db8a9bd1f86e602 Mon Sep 17 00:00:00 2001 From: Samuel Ainsworth Date: Mon, 1 Feb 2021 04:03:03 -0800 Subject: vscode: fix update script (#110096) Co-authored-by: Sandro --- pkgs/applications/editors/vscode/update-vscode.sh | 5 ++--- 1 file 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'' '{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" -- cgit v1.2.3