kiro: add handling of vscode version to update script

This commit is contained in:
Vuks69
2025-09-20 23:18:17 +02:00
parent 19c2047464
commit 9797411a82
+8
View File
@@ -89,9 +89,17 @@ for platform in "${!platform_urls[@]}"; do
platform_hashes["$platform"]=$(nix hash convert --hash-algo sha256 "$(nix-prefetch-url "${platform_urls[$platform]}")")
done
# Extract vscode version from the Linux tar.gz archive using nix-prefetch-url
archive_path=$(nix-prefetch-url --print-path "${platform_urls["x86_64-linux"]}" | tail -1)
vscodeVersion=$(tar -Oxzf "$archive_path" "Kiro/resources/app/product.json" | jq -r '.vsCodeVersion')
if [[ -z "$vscodeVersion" || "$vscodeVersion" == "null" ]]; then
error_exit "Could not extract vsCodeVersion from product.json"
fi
# Update package.nix and generate sources.json
echo "Updating package.nix..."
sed -i "s/version = \".*\"/version = \"$max_version\"/" "$PACKAGE_NIX"
sed -i "s/vscodeVersion = \".*\"/vscodeVersion = \"$vscodeVersion\"/" "$PACKAGE_NIX"
echo "Generating sources.json..."
json_content="{}"