mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 18:26:26 +00:00
Stream EPIPEエラー解決、データはこれからJSON保存
This commit is contained in:
21
main.js
21
main.js
@@ -93,13 +93,14 @@ 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'), '--finder'], {
|
||||
stdio: 'pipe'
|
||||
})
|
||||
finderProcess.stdout.on('data', format)
|
||||
finderProcess.stderr.on('data', errorFormat)
|
||||
if (finderProcess == null) {
|
||||
finderProcess = ChildProcess
|
||||
.execFile(process.execPath, [path.resolve(__dirname, 'finder.js'), '--finder'])
|
||||
finderProcess.stdout.setEncoding('utf8')
|
||||
finderProcess.stderr.setEncoding('utf8')
|
||||
finderProcess.stdout.on('data', format)
|
||||
finderProcess.stderr.on('data', errorFormat)
|
||||
}
|
||||
|
||||
if (update != null) {
|
||||
mainWindow.webContents.send('update-available', 'whoooooooh!')
|
||||
@@ -152,13 +153,9 @@ app.on('ready', function () {
|
||||
type: type,
|
||||
data: data
|
||||
}
|
||||
finderProcess.stdin.write(JSON.stringify(payload))
|
||||
finderProcess.stdin.write(JSON.stringify(payload), 'utf-8')
|
||||
}
|
||||
|
||||
ipc.on('refresh-data', function (e, data) {
|
||||
emitToFinder('refresh-data', data)
|
||||
})
|
||||
|
||||
var userDataPath = app.getPath('userData')
|
||||
if (!jetpack.cwd(userDataPath).exists('keymap.json')) {
|
||||
jetpack.cwd(userDataPath).file('keymap.json', {content: '{}'})
|
||||
|
||||
Reference in New Issue
Block a user