From 91226bbb3966f31ae455f0894add7f9c0bcb9c26 Mon Sep 17 00:00:00 2001 From: Lilac Date: Sat, 21 Dec 2024 07:04:24 +0000 Subject: [PATCH] code-marketplace: auto updated to 1.95.0-1 --- repo/code-marketplace/PKGBUILD | 4 +-- repo/code-marketplace/patch.json | 13 +++++++-- repo/code-marketplace/update.py | 50 +++++++++++++++++++++++--------- 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/repo/code-marketplace/PKGBUILD b/repo/code-marketplace/PKGBUILD index c18e311..a3b2eb0 100644 --- a/repo/code-marketplace/PKGBUILD +++ b/repo/code-marketplace/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Sainnhe Park pkgname=code-marketplace -pkgver=1.90.0 +pkgver=1.95.0 pkgrel=1 pkgdesc='Enable vscode marketplace in Code OSS' arch=('any') @@ -14,7 +14,7 @@ source=('code-marketplace.hook' 'patch.json') md5sums=('ce502275aa945985182b51420fc6037c' '9ed6f3972479ab6d3d053e7c47ead55a' - '56531cac5e74070cde3229c0a5e1503b') + '63fcab1dcfb25eacc2697cae3d650ff3') package() { install -Dm 644 "${srcdir}"/code-marketplace.hook "${pkgdir}"/usr/share/libalpm/hooks/code-marketplace.hook diff --git a/repo/code-marketplace/patch.json b/repo/code-marketplace/patch.json index a780862..1209ad1 100644 --- a/repo/code-marketplace/patch.json +++ b/repo/code-marketplace/patch.json @@ -504,10 +504,12 @@ "GitHub.copilot": { "onFileOpen": [ { - "pathGlob": "{**/*.ts,**/*.tsx,**/*.js,**/*.py,**/*.go,**/*.rb}" + "pathGlob": "{**/*.ts,**/*.tsx,**/*.js,**/*.jsx,**/*.py,**/*.go,**/*.rb,**/*.html,**/*.css,**/*.php,**/*.cpp,**/*.vue,**/*.c,**/*.sql,**/*.java,**/*.cs,**/*.rs,**/*.dart,**/*.ps,**/*.ps1,**/*.tex}" } ], - "onSettingsEditorOpen": {} + "onSettingsEditorOpen": { + "descriptionOverride": "GitHub Copilot is an AI pair programmer tool that helps you write code faster and smarter." + } }, "GitHub.vscode-github-actions": { "onFileOpen": [ @@ -539,6 +541,13 @@ "important": true } ] + }, + "Redis.redis-for-vscode": { + "onFileOpen": [ + { + "pathGlob": "{**/redis.*,**/redis-server.*,**/redis_*,**/redisinsight.*}" + } + ] } }, "keymapExtensionTips": [ diff --git a/repo/code-marketplace/update.py b/repo/code-marketplace/update.py index baa936d..a5058ab 100755 --- a/repo/code-marketplace/update.py +++ b/repo/code-marketplace/update.py @@ -1,11 +1,14 @@ #!/usr/bin/env python3 -# This script can update the content of ./patch.json to the latest version -# Usage: ./update.py /path/to/extracted/produce.json -# Where /path/to/extracted/produce.json is extracted from the latest version of official vscode release +# This script will update the ./patch.json to match the official release +# Usage: ./update.py +# Where is the version of the official release -import sys import json +import os +import shutil +import subprocess +import sys key_list = [ "extensionsGallery", @@ -19,19 +22,38 @@ key_list = [ "extensionAllowedBadgeProviders", "extensionAllowedBadgeProvidersRegex", "msftInternalDomains", - "linkProtectionTrustedDomains" + "linkProtectionTrustedDomains", ] -product_path = sys.argv[1] -patch_path = "patch.json" -with open(product_path, "r") as product_file: - product_data = json.load(product_file) +def fetch_product_json(version: str): + """Download official release and extract it, then copy product.json to project root""" + url = f"https://update.code.visualstudio.com/{version}/linux-x64/stable" + download_cmd = ["curl", "-fSL", "-o", "code.tgz", url] + subprocess.run(download_cmd) + extract_cmd = ["tar", "xvf", "code.tgz"] + subprocess.run(extract_cmd) + shutil.copy(src="./VSCode-linux-x64/resources/app/product.json", dst=".") + shutil.rmtree("./VSCode-linux-x64") + os.remove("code.tgz") -patch_data = {} -for key in key_list: - patch_data[key] = product_data[key] +def update_package(): + """Update the package""" + with open("./product.json", "r") as product_file: + product_data = json.load(product_file) -with open(patch_path, "w") as patch_file: - json.dump(patch_data, patch_file, indent='\t') + patch_data = {} + + for key in key_list: + patch_data[key] = product_data[key] + + with open("./patch.json", "w") as patch_file: + json.dump(patch_data, patch_file, indent="\t") + + subprocess.run(["updpkgsums", "./PKGBUILD"]) + + +version = sys.argv[1] +fetch_product_json(version) +update_package()