Skip to content

Commit

Permalink
fix: make sure user-data-dir command line parameter is customizable
Browse files Browse the repository at this point in the history
The `--user-data-dir` command-line parameter is currently unusable. Its functionality is hampered due to an automatically appended `/data` directory, rendering the parameter completely ineffective.

The proposed minor modification allows users to accurately customize this variable, enhancing its utility.
  • Loading branch information
drupol authored and jeanp413 committed Jun 7, 2023
1 parent c931aeb commit de72d39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/server/node/server.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ const errorReporter: ErrorReporter = {
const args = parseArgs(process.argv.slice(2), serverOptions, errorReporter);

const REMOTE_DATA_FOLDER = args['server-data-dir'] || process.env['VSCODE_AGENT_FOLDER'] || join(os.homedir(), product.serverDataFolderName || '.vscode-remote');
const USER_DATA_PATH = join(REMOTE_DATA_FOLDER, 'data');
const USER_DATA_PATH = args['user-data-dir'] || join(REMOTE_DATA_FOLDER, 'data');
const APP_SETTINGS_HOME = join(USER_DATA_PATH, 'User');
const GLOBAL_STORAGE_HOME = join(APP_SETTINGS_HOME, 'globalStorage');
const LOCAL_HISTORY_HOME = join(APP_SETTINGS_HOME, 'History');
const MACHINE_SETTINGS_HOME = join(USER_DATA_PATH, 'Machine');
args['user-data-dir'] = USER_DATA_PATH;
const APP_ROOT = dirname(FileAccess.asFileUri('').fsPath);
const BUILTIN_EXTENSIONS_FOLDER_PATH = join(APP_ROOT, 'extensions');
args['user-data-dir'] = USER_DATA_PATH;
args['builtin-extensions-dir'] = BUILTIN_EXTENSIONS_FOLDER_PATH;
args['extensions-dir'] = args['extensions-dir'] || join(REMOTE_DATA_FOLDER, 'extensions');

Expand Down

0 comments on commit de72d39

Please sign in to comment.