spawn returns an object, not stdout
This commit is contained in:
Родитель
e456ec92d5
Коммит
1858c9748f
|
@ -43,9 +43,11 @@ const spawnWithHeadersDir = async (cmd, args, headersDir, cwd) => {
|
|||
|
||||
const getElectronModuleVersion = async (pathToElectronExecutable) => {
|
||||
let args = [ '-e', 'console.log(process.versions.modules)' ]
|
||||
let env = _.extend({}, process.env, { ATOM_SHELL_INTERNAL_RUN_AS_NODE: '1' });
|
||||
let env = { ATOM_SHELL_INTERNAL_RUN_AS_NODE: '1' };
|
||||
|
||||
let result = await spawn({cmd: pathToElectronExecutable, args, opts: {env}});
|
||||
let versionAsString = (result.stdout + result.stderr).replace(/\n/g, '');
|
||||
|
||||
let versionAsString = await spawn({cmd: pathToElectronExecutable, args, opts: {env}});
|
||||
if (!versionAsString.match(/^\d+$/)) {
|
||||
throw new Error(`Failed to check Electron's module version number: ${versionAsString}`);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче