Command line code . not working (fix #126702)

This commit is contained in:
Benjamin Pasero 2021-06-19 08:03:42 +02:00
parent 20f2b31316
commit f555564a4b
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65

12
src/bootstrap-node.js vendored
View file

@ -9,16 +9,18 @@
// Setup current working directory in all our node & electron processes
// - Windows: call `process.chdir()` to always set application folder as cwd
// - all OS: store the `process.cwd()` inside `VSCODE_CWD` for consistent lookups
// TODO@bpasero revisit if chdir() on Windows is needed in the future still
// (find all users of `chdir` in code, there are more locations)
function setupCurrentWorkingDirectory() {
const path = require('path');
try {
// allOS: store the `process.cwd()` inside `VSCODE_CWD`
// for consistent lookups
process.env['VSCODE_CWD'] = process.cwd();
// Store the `process.cwd()` inside `VSCODE_CWD`
// for consistent lookups, but make sure to only
// do this once unless defined already from e.g.
// a parent process.
if (typeof process.env['VSCODE_CWD'] !== 'string') {
process.env['VSCODE_CWD'] = process.cwd();
}
// Windows: always set application folder as current working dir
if (process.platform === 'win32') {