diff --git a/src/main.js b/src/main.js index afe479d6174d9d61e822e4b7a74cd7faa33008b7..8db96e5272b3e616e3123ad79f2ba956272f247d 100644 --- a/src/main.js +++ b/src/main.js @@ -32,6 +32,14 @@ const args = parseCLIArgs(); const userDataPath = getUserDataPath(args); app.setPath('userData', userDataPath); +// Set logs path before app 'ready' event if running portable +// to ensure that no 'logs' folder is created on disk at a +// location outside of the portable directory +// (https://github.com/microsoft/vscode/issues/56651) +if (portable.isPortable) { + app.setAppLogsPath(path.join(userDataPath, 'logs')); +} + // Update cwd based on environment and platform setCurrentWorkingDirectory();