提交 0b7e00a6 编写于 作者: J Johannes Rieken

temporary warning when acceessing unknown env-variable while lazyEnv loads

上级 3212cd3e
......@@ -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);
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册