mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
intercept entry point
This commit is contained in:
6
index.js
Normal file
6
index.js
Normal 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')
|
||||||
|
}
|
||||||
3
main.js
3
main.js
@@ -87,8 +87,9 @@ app.on('ready', function () {
|
|||||||
mainWindow.hide()
|
mainWindow.hide()
|
||||||
})
|
})
|
||||||
mainWindow.webContents.on('did-finish-load', function () {
|
mainWindow.webContents.on('did-finish-load', function () {
|
||||||
|
require('module')._load(path.resolve(__dirname, 'finder.js'), module, true)
|
||||||
finderProcess = ChildProcess
|
finderProcess = ChildProcess
|
||||||
.execFile(process.execPath, [path.resolve(__dirname, 'finder.js')], {
|
.execFile(process.execPath, [path.resolve(__dirname, 'finder.js'), '--finder'], {
|
||||||
stdio: 'pipe'
|
stdio: 'pipe'
|
||||||
})
|
})
|
||||||
finderProcess.stdout.on('data', format)
|
finderProcess.stdout.on('data', format)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "boost",
|
"name": "boost",
|
||||||
"version": "0.4.1-beta.4",
|
"version": "0.4.1-beta.4",
|
||||||
"description": "Boost App",
|
"description": "Boost App",
|
||||||
"main": "main.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "BOOST_ENV=development electron ./main.js",
|
"start": "BOOST_ENV=development electron ./main.js",
|
||||||
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js",
|
"webpack": "webpack-dev-server --hot --inline --config webpack.config.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user