mirror of
https://github.com/VSCodium/vscodium.git
synced 2026-04-19 13:46:03 +10:00
Merge pull request #728 from daiyam/fix-gallery
fix custom gallery on windows
This commit is contained in:
4
DOCS.md
4
DOCS.md
@@ -60,9 +60,9 @@ With the following environment variables:
|
|||||||
- `VSCODE_GALLERY_RECOMMENDATIONS_URL=''`
|
- `VSCODE_GALLERY_RECOMMENDATIONS_URL=''`
|
||||||
|
|
||||||
Or by creating a custom `product.json` at the following location:
|
Or by creating a custom `product.json` at the following location:
|
||||||
- Windows: `%USER%\AppData\Roaming\VSCodium`
|
- Windows: `%APPDATA%\VSCodium` or `%USERPROFILE%\AppData\Roaming\VSCodium`
|
||||||
- macOS: `~/Library/Application Support/VSCodium`
|
- macOS: `~/Library/Application Support/VSCodium`
|
||||||
- Linux: `~/.config/VSCodium`
|
- Linux: `$XDG_CONFIG_HOME/VSCodium` or `~/.config/VSCodium`
|
||||||
|
|
||||||
with the content:
|
with the content:
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,26 @@
|
|||||||
|
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
|
||||||
|
index 129b8de..fadb99a 100644
|
||||||
|
--- a/src/vs/base/common/product.ts
|
||||||
|
+++ b/src/vs/base/common/product.ts
|
||||||
|
@@ -62,6 +62,7 @@ export interface IProductConfiguration {
|
||||||
|
|
||||||
|
readonly extensionsGallery?: {
|
||||||
|
readonly serviceUrl: string;
|
||||||
|
+ readonly cacheUrl?: string;
|
||||||
|
readonly itemUrl: string;
|
||||||
|
readonly controlUrl: string;
|
||||||
|
readonly recommendationsUrl: string;
|
||||||
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
|
diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts
|
||||||
index d79c8a3..7a25774 100644
|
index d79c8a3..8b4153f 100644
|
||||||
--- a/src/vs/platform/product/common/product.ts
|
--- a/src/vs/platform/product/common/product.ts
|
||||||
+++ b/src/vs/platform/product/common/product.ts
|
+++ b/src/vs/platform/product/common/product.ts
|
||||||
@@ -9,6 +9,7 @@ import { env } from 'vs/base/common/process';
|
@@ -4,11 +4,12 @@
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import { FileAccess } from 'vs/base/common/network';
|
||||||
|
-import { isWeb, globals } from 'vs/base/common/platform';
|
||||||
|
+import { isWeb, isWindows, globals } from 'vs/base/common/platform';
|
||||||
|
import { env } from 'vs/base/common/process';
|
||||||
import { dirname, joinPath } from 'vs/base/common/resources';
|
import { dirname, joinPath } from 'vs/base/common/resources';
|
||||||
import { IProductConfiguration } from 'vs/base/common/product';
|
import { IProductConfiguration } from 'vs/base/common/product';
|
||||||
import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes';
|
import { ISandboxConfiguration } from 'vs/base/parts/sandbox/common/sandboxTypes';
|
||||||
@@ -10,7 +28,7 @@ index d79c8a3..7a25774 100644
|
|||||||
|
|
||||||
let product: IProductConfiguration;
|
let product: IProductConfiguration;
|
||||||
|
|
||||||
@@ -31,6 +32,29 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
@@ -31,6 +32,32 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
||||||
product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath);
|
product = require.__$__nodeRequire(joinPath(rootPath, 'product.json').fsPath);
|
||||||
const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; };
|
const pkg = require.__$__nodeRequire(joinPath(rootPath, 'package.json').fsPath) as { version: string; };
|
||||||
|
|
||||||
@@ -31,16 +49,19 @@ index d79c8a3..7a25774 100644
|
|||||||
+ return result;
|
+ return result;
|
||||||
+ }, {}) as any;
|
+ }, {}) as any;
|
||||||
+
|
+
|
||||||
+ const userProduct = require.__$__nodeRequire(joinPath(FileAccess.asFileUri(getUserDataPath({} as any), require), 'product.json').fsPath);
|
+ const userDataPath = getUserDataPath({} as any);
|
||||||
|
+ const userProductPath = isWindows ? `file:///${userDataPath}/product.json` : `file://${userDataPath}/product.json`;
|
||||||
+
|
+
|
||||||
+ product = merge(product, userProduct)
|
+ const userProduct = require.__$__nodeRequire(FileAccess.asFileUri(userProductPath, require).fsPath);
|
||||||
|
+
|
||||||
|
+ product = merge(product, userProduct);
|
||||||
+ } catch (ex) {
|
+ } catch (ex) {
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
// Running out of sources
|
// Running out of sources
|
||||||
if (env['VSCODE_DEV']) {
|
if (env['VSCODE_DEV']) {
|
||||||
Object.assign(product, {
|
Object.assign(product, {
|
||||||
@@ -40,6 +64,19 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
@@ -40,6 +67,19 @@ else if (typeof require?.__$__nodeRequire === 'function') {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,16 +81,3 @@ index d79c8a3..7a25774 100644
|
|||||||
Object.assign(product, {
|
Object.assign(product, {
|
||||||
version: pkg.version
|
version: pkg.version
|
||||||
});
|
});
|
||||||
|
|
||||||
diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts
|
|
||||||
index 129b8de..fadb99a 100644
|
|
||||||
--- a/src/vs/base/common/product.ts
|
|
||||||
+++ b/src/vs/base/common/product.ts
|
|
||||||
@@ -62,6 +62,7 @@ export interface IProductConfiguration {
|
|
||||||
|
|
||||||
readonly extensionsGallery?: {
|
|
||||||
readonly serviceUrl: string;
|
|
||||||
+ readonly cacheUrl?: string;
|
|
||||||
readonly itemUrl: string;
|
|
||||||
readonly controlUrl: string;
|
|
||||||
readonly recommendationsUrl: string;
|
|
||||||
|
|||||||
Reference in New Issue
Block a user