vscode-extensions: use sri hashes in update script

This commit is contained in:
Raroh73
2025-02-12 22:48:44 +01:00
parent b2243f41e8
commit 9cddbd5a5f
@@ -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
}