vscode-extensions: use sri hashes in update script (#381560)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user