mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 (#15681)
* Merge from vscode a348d103d1256a06a2c9b3f9b406298a9fef6898 * Fixes and cleanup * Distro * Fix hygiene yarn * delete no yarn lock changes file * Fix hygiene * Fix layer check * Fix CI * Skip lib checks * Remove tests deleted in vs code * Fix tests * Distro * Fix tests and add removed extension point * Skip failing notebook tests for now * Disable broken tests and cleanup build folder * Update yarn.lock and fix smoke tests * Bump sqlite * fix contributed actions and file spacing * Fix user data path * Update yarn.locks Co-authored-by: ADS Merger <karlb@microsoft.com>
This commit is contained in:
38
src/bootstrap-node.js
vendored
38
src/bootstrap-node.js
vendored
@@ -6,6 +6,42 @@
|
||||
//@ts-check
|
||||
'use strict';
|
||||
|
||||
// Setup current working directory in all our node & electron processes
|
||||
// - Windows: call `process.chdir()` to always set application folder as cwd
|
||||
// - Posix: allow to change the current working dir via `VSCODE_CWD` if defined
|
||||
// - 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
|
||||
function setupCurrentWorkingDirectory() {
|
||||
const path = require('path');
|
||||
|
||||
try {
|
||||
let cwd = process.env['VSCODE_CWD'];
|
||||
|
||||
// remember current working directory in environment
|
||||
// unless it was given to us already from outside
|
||||
if (typeof cwd !== 'string') {
|
||||
cwd = process.cwd();
|
||||
process.env['VSCODE_CWD'] = cwd;
|
||||
}
|
||||
|
||||
// Windows: always set application folder as current working dir
|
||||
if (process.platform === 'win32') {
|
||||
process.chdir(path.dirname(process.execPath));
|
||||
}
|
||||
|
||||
// Linux/macOS: allow to change current working dir based on env
|
||||
else {
|
||||
if (cwd !== process.cwd()) {
|
||||
process.chdir(cwd);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
setupCurrentWorkingDirectory();
|
||||
|
||||
/**
|
||||
* Add support for redirecting the loading of node modules
|
||||
*
|
||||
@@ -62,7 +98,7 @@ exports.removeGlobalNodeModuleLookupPaths = function () {
|
||||
/**
|
||||
* Helper to enable portable mode.
|
||||
*
|
||||
* @param {Partial<import('./vs/platform/product/common/productService').IProductConfiguration>} product
|
||||
* @param {Partial<import('./vs/base/common/product').IProductConfiguration>} product
|
||||
* @returns {{ portableDataPath: string; isPortable: boolean; }}
|
||||
*/
|
||||
exports.configurePortable = function (product) {
|
||||
|
||||
Reference in New Issue
Block a user