🐛 Don't load 'repl' unless needed
Git bisect revealed that process.stdout failed to initiate (and was replaced with a write stream that does nothing) when the 'repl' module was loaded. This commit moves `require('repl')` so that it is only loaded when the --interactive flag is present. Fixes #5051
This commit is contained in:
parent
52350b5e35
commit
3c7c584444
2 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,6 @@ const {app, dialog, shell, Menu} = require('electron')
|
|||
const fs = require('fs')
|
||||
const Module = require('module')
|
||||
const path = require('path')
|
||||
const repl = require('repl')
|
||||
const url = require('url')
|
||||
|
||||
// Parse command line options.
|
||||
|
@ -315,6 +314,7 @@ function startRepl () {
|
|||
return
|
||||
}
|
||||
|
||||
const repl = require('repl')
|
||||
repl.start('> ').on('exit', () => {
|
||||
process.exit(0)
|
||||
})
|
||||
|
|
|
@ -225,7 +225,7 @@ describe('node feature', function () {
|
|||
process.stdout.write('test')
|
||||
})
|
||||
|
||||
xit('should have isTTY defined', function () {
|
||||
it('should have isTTY defined', function () {
|
||||
assert.equal(typeof process.stdout.isTTY, 'boolean')
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue