UNC follow up changes (#181946)

* settings include update

* more cleanup
This commit is contained in:
Benjamin Pasero
2023-05-09 22:02:51 +02:00
committed by GitHub
parent a99c29b544
commit 2e671b3a29
9 changed files with 210 additions and 75 deletions

View File

@@ -22,6 +22,7 @@ const bootstrap = require('./bootstrap');
const bootstrapNode = require('./bootstrap-node');
const { getUserDataPath } = require('./vs/platform/environment/node/userDataPath');
const { stripComments } = require('./vs/base/common/stripComments');
const { getUNCHost, addUNCHostToAllowlist } = require('./vs/base/node/unc');
/** @type {Partial<IProductConfiguration>} */
const product = require('../product.json');
const { app, protocol, crashReporter, Menu } = require('electron');
@@ -35,6 +36,12 @@ bootstrap.enableASARSupport();
// Set userData path before app 'ready' event
const args = parseCLIArgs();
const userDataPath = getUserDataPath(args, product.nameShort ?? 'code-oss-dev');
if (process.platform === 'win32') {
const userDataUNCHost = getUNCHost(userDataPath);
if (userDataUNCHost) {
addUNCHostToAllowlist(userDataUNCHost); // enables to use UNC paths in userDataPath
}
}
app.setPath('userData', userDataPath);
// Resolve code cache path