| 44 | } |
| 45 | |
| 46 | function executeNodeScript(scriptPath, url) { |
| 47 | const extraArgs = process.argv.slice(2); |
| 48 | const child = spawn(process.execPath, [scriptPath, ...extraArgs, url], { |
| 49 | stdio: 'inherit', |
| 50 | }); |
| 51 | child.on('close', code => { |
| 52 | if (code !== 0) { |
| 53 | console.log(); |
| 54 | console.log( |
| 55 | chalk.red( |
| 56 | 'The script specified as BROWSER environment variable failed.' |
| 57 | ) |
| 58 | ); |
| 59 | console.log(chalk.cyan(scriptPath) + ' exited with code ' + code + '.'); |
| 60 | console.log(); |
| 61 | return; |
| 62 | } |
| 63 | }); |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | function startBrowserProcess(browser, url, args) { |
| 68 | // If we're on OS X, the user hasn't specifically |