1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-21 13:41:40 +00:00

fixed eslint error & integrated with prettier as well as formatted the whole codebase (#3450)

This commit is contained in:
Nguyen Viet Hung
2020-02-05 13:28:27 +13:00
committed by GitHub
parent 051ce9e208
commit 592aca1539
186 changed files with 9233 additions and 5565 deletions

View File

@@ -4,30 +4,30 @@ const path = require('path')
var error = null
function execMainApp () {
function execMainApp() {
const appRootPath = path.join(process.execPath, '../..')
const updateDotExePath = path.join(appRootPath, 'Update.exe')
const exeName = path.basename(process.execPath)
function spawnUpdate (args, cb) {
function spawnUpdate(args, cb) {
var stdout = ''
var updateProcess = null
try {
updateProcess = ChildProcess.spawn(updateDotExePath, args)
} catch (e) {
process.nextTick(function () {
process.nextTick(function() {
cb(e)
})
}
updateProcess.stdout.on('data', function (data) {
updateProcess.stdout.on('data', function(data) {
stdout += data
})
updateProcess.on('error', function (_error) {
updateProcess.on('error', function(_error) {
error = _error
})
updateProcess.on('close', function (code, signal) {
updateProcess.on('close', function(code, signal) {
if (code !== 0) {
error = new Error('Command failed: #{signal ? code}')
error.code = code
@@ -38,7 +38,7 @@ function execMainApp () {
})
}
var handleStartupEvent = function () {
var handleStartupEvent = function() {
if (process.platform !== 'win32') {
return false
}
@@ -46,7 +46,7 @@ function execMainApp () {
var squirrelCommand = process.argv[1]
switch (squirrelCommand) {
case '--squirrel-install':
spawnUpdate(['--createShortcut', exeName], function (err) {
spawnUpdate(['--createShortcut', exeName], function(err) {
if (err) console.error(err)
app.quit()
})
@@ -55,7 +55,7 @@ function execMainApp () {
app.quit()
return true
case '--squirrel-uninstall':
spawnUpdate(['--removeShortcut', exeName], function (err) {
spawnUpdate(['--removeShortcut', exeName], function(err) {
if (err) console.error(err)
app.quit()
})