Browse Source

Add patch for custom extensions gallery

Extend product.ts to accept environment variables for custom extensions gallery URLs
articlecat 4 năm trước cách đây
mục cha
commit
dad2a98413
1 tập tin đã thay đổi với 28 bổ sung0 xóa
  1. 28 0
      patches/custom-extensions-gallery.patch

+ 28 - 0
patches/custom-extensions-gallery.patch

@@ -0,0 +1,28 @@
+diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
+index 2bea85740c..d0e9da036c 100644
+--- a/src/vs/platform/product/common/product.ts
++++ b/src/vs/platform/product/common/product.ts
+@@ -57,6 +57,23 @@ else {
+ 		});
+ 	}
+ 
++	// Set user-defined extension gallery
++	if (
++		env['VSCODIUM_EXTENSIONS_GALLERY_SERVICE_URL']
++		|| env['VSCODIUM_EXTENSIONS_GALLERY_ITEM_URL']
++		|| env['VSCODIUM_EXTENSIONS_GALLERY_CONTROL_URL']
++		|| env['VSCODIUM_EXTENSIONS_GALLERY_RECOMMENDATIONS_URL']
++	) {
++		Object.assign(product, {
++			extensionsGallery: {
++				serviceUrl: env['VSCODIUM_EXTENSIONS_GALLERY_SERVICE_URL'],
++				itemUrl: env['VSCODIUM_EXTENSIONS_GALLERY_ITEM_URL'],
++				controlUrl: env['VSCODIUM_EXTENSIONS_GALLERY_CONTROL_URL'],
++				recommendationsUrl: env['VSCODIUM_EXTENSIONS_GALLERY_RECOMMENDATIONS_URL']
++			}
++		})
++	}
++
+ 	Object.assign(product, {
+ 		version: pkg.version
+ 	});