diff --git a/index.js b/index.js new file mode 100644 index 00000000..dea5635b --- /dev/null +++ b/index.js @@ -0,0 +1,6 @@ +var argv = process.argv.slice(1) +if (argv.some(arg => arg.match(/--finder/))) { + require('./finder.js') +} else { + require('./main.js') +} diff --git a/main.js b/main.js index fde31fe8..c8fc050a 100644 --- a/main.js +++ b/main.js @@ -87,8 +87,9 @@ app.on('ready', function () { mainWindow.hide() }) mainWindow.webContents.on('did-finish-load', function () { + require('module')._load(path.resolve(__dirname, 'finder.js'), module, true) finderProcess = ChildProcess - .execFile(process.execPath, [path.resolve(__dirname, 'finder.js')], { + .execFile(process.execPath, [path.resolve(__dirname, 'finder.js'), '--finder'], { stdio: 'pipe' }) finderProcess.stdout.on('data', format) diff --git a/package.json b/package.json index 20b2f82a..d3d429d7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "boost", "version": "0.4.1-beta.4", "description": "Boost App", - "main": "main.js", + "main": "index.js", "scripts": { "start": "BOOST_ENV=development electron ./main.js", "webpack": "webpack-dev-server --hot --inline --config webpack.config.js",