vscode-extensions: use sri hashes in update script (#381560)

This commit is contained in:
Pol Dellaiera
2025-02-14 22:20:04 +01:00
committed by GitHub
@@ -43,8 +43,8 @@ function get_vsixpkg() {
curl --silent --show-error --retry 3 --fail -X GET -o "$EXTTMP/$N.zip" "$URL"
# Unpack the file we need to stdout then pull out the version
VER=$(jq -r '.version' <(unzip -qc "$EXTTMP/$N.zip" "extension/package.json"))
# Calculate the SHA
SHA=$(nix-hash --flat --base32 --type sha256 "$EXTTMP/$N.zip")
# Calculate the hash
HASH=$(nix-hash --flat --sri --type sha256 "$EXTTMP/$N.zip")
# Clean up.
rm -Rf "$EXTTMP"
@@ -55,7 +55,7 @@ function get_vsixpkg() {
name = "$2";
publisher = "$1";
version = "$VER";
sha256 = "$SHA";
hash = "$HASH";
}
EOF
}