mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
Command line code . not working (fix #126702)
This commit is contained in:
parent
20f2b31316
commit
f555564a4b
12
src/bootstrap-node.js
vendored
12
src/bootstrap-node.js
vendored
|
@ -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') {
|
||||
|
|
Loading…
Reference in a new issue