1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

intercept entry point

This commit is contained in:
Rokt33r
2015-11-24 04:16:43 +09:00
parent e5a2bfbcbd
commit e4f39d2b6a
3 changed files with 9 additions and 2 deletions

6
index.js Normal file
View File

@@ -0,0 +1,6 @@
var argv = process.argv.slice(1)
if (argv.some(arg => arg.match(/--finder/))) {
require('./finder.js')
} else {
require('./main.js')
}

View File

@@ -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)

View File

@@ -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",