mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
VSCODE_APPDATA
This commit is contained in:
11
src/paths.js
11
src/paths.js
@@ -8,18 +8,17 @@ var os = require('os');
|
||||
var pkg = require('../package.json');
|
||||
|
||||
function getAppDataPath(platform) {
|
||||
const userPath = process.env['vscode_config_prefix'];
|
||||
switch (platform) {
|
||||
case 'win32': return userPath || process.env['APPDATA'] || path.join(process.env['USERPROFILE'], 'AppData', 'Roaming');
|
||||
case 'darwin': return userPath || path.join(os.homedir(), 'Library', 'Application Support');
|
||||
case 'linux': return userPath || process.env['XDG_CONFIG_HOME'] || path.join(os.homedir(), '.config');
|
||||
case 'win32': return process.env['VSCODE_APPDATA'] || process.env['APPDATA'] || path.join(process.env['USERPROFILE'], 'AppData', 'Roaming');
|
||||
case 'darwin': return process.env['VSCODE_APPDATA'] || path.join(os.homedir(), 'Library', 'Application Support');
|
||||
case 'linux': return process.env['VSCODE_APPDATA'] || process.env['XDG_CONFIG_HOME'] || path.join(os.homedir(), '.config');
|
||||
default: throw new Error('Platform not supported');
|
||||
}
|
||||
}
|
||||
|
||||
function getDefaultUserDataPath(platform) {
|
||||
|
||||
return path.join(getAppDataPath(platform), pkg.name);
|
||||
}
|
||||
|
||||
exports.getAppDataPath = getAppDataPath;
|
||||
exports.getDefaultUserDataPath = getDefaultUserDataPath;
|
||||
exports.getDefaultUserDataPath = getDefaultUserDataPath;
|
||||
Reference in New Issue
Block a user