mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-15 08:23:37 +01:00
temporary warning when acceessing unknown env-variable while lazyEnv loads
This commit is contained in:
@@ -16,7 +16,24 @@ const ipc = electron.ipcRenderer;
|
||||
|
||||
|
||||
process.lazyEnv = new Promise(function (resolve) {
|
||||
|
||||
const origEnv = process.env;
|
||||
|
||||
// warn about missing environment variables
|
||||
// while we are resolve lazyEnv
|
||||
process.env = new Proxy(origEnv, {
|
||||
get: function (target, name) {
|
||||
const result = target[name];
|
||||
if (typeof result === 'undefined') {
|
||||
console.warn('process.env[\'' + name + '\'] is undefined AND \'process.lazyEnv\' is NOT READY yet.');
|
||||
}
|
||||
return result;
|
||||
}
|
||||
});
|
||||
|
||||
ipc.once('vscode:acceptShellEnv', function (event, shellEnv) {
|
||||
// store process.env, mixin shellEnv, done
|
||||
process.env = origEnv;
|
||||
assign(process.env, shellEnv);
|
||||
resolve(process.env);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user