1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-14 10:16:26 +00:00

cleanup code

This commit is contained in:
Rokt33r
2015-12-20 15:47:29 +09:00
parent 52df793a74
commit 8e64abc4bc
4 changed files with 20 additions and 20 deletions

View File

@@ -1,8 +1,6 @@
const electron = require('electron') const electron = require('electron')
const app = electron.app const app = electron.app
const Menu = electron.Menu const Menu = electron.Menu
const ipcMain = electron.ipcMain
const path = require('path')
var finderWindow = null var finderWindow = null
@@ -24,4 +22,3 @@ app.on('ready', function () {
finderWindow.hide() finderWindow.hide()
}) })
}) })

View File

@@ -5,8 +5,6 @@ const archiver = require('archiver')
const fs = require('fs') const fs = require('fs')
module.exports = function (grunt) { module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({ grunt.initConfig({
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
auth_code: grunt.file.readJSON('secret/auth_code.json'), auth_code: grunt.file.readJSON('secret/auth_code.json'),
@@ -25,27 +23,31 @@ module.exports = function (grunt) {
} }
} }
}) })
grunt.loadNpmTasks('grunt-electron-installer') grunt.loadNpmTasks('grunt-electron-installer')
grunt.registerTask('compile', function () { grunt.registerTask('compile', function () {
var done = this.async() var done = this.async()
var execPath = path.join('node_modules', '.bin', 'webpack') + ' --config webpack.config.production.js' var execPath = path.join('node_modules', '.bin', 'webpack') + ' --config webpack.config.production.js'
grunt.log.writeln(execPath) grunt.log.writeln(execPath)
var compileProcess = ChildProcess.exec(execPath, ChildProcess.exec(execPath,
{ {
env: Object.assign({}, process.env, { env: Object.assign({}, process.env, {
BABEL_ENV: 'production' BABEL_ENV: 'production'
}) })
}, function (err, stdout, stderr) { },
grunt.log.writeln(stdout) function (err, stdout, stderr) {
if (err) { grunt.log.writeln(stdout)
grunt.log.writeln(err)
grunt.log.writeln(stderr) if (err) {
done(false) grunt.log.writeln(err)
return grunt.log.writeln(stderr)
done(false)
return
}
done()
} }
done() )
})
}) })
grunt.registerTask('zip', function (platform) { grunt.registerTask('zip', function (platform) {
@@ -53,10 +55,13 @@ module.exports = function (grunt) {
var archive = archiver.create('zip', {}) var archive = archiver.create('zip', {})
switch (platform) { switch (platform) {
case 'win': case 'win':
archive.file(path.join('dist/Setup.exe'), { name:'Boostnote-installer-win32-x64.exe' }) archive.file(path.join('dist/Setup.exe'), {
name: 'Boostnote-installer-win32-x64.exe'
})
break
default: default:
done() done()
return break
} }
archive.finalize() archive.finalize()
var writeStream = fs.createWriteStream(path.join('dist/Boostnote-installer-win32-x64.zip')) var writeStream = fs.createWriteStream(path.join('dist/Boostnote-installer-win32-x64.zip'))

View File

@@ -1,10 +1,8 @@
const electron = require('electron') const electron = require('electron')
const app = electron.app const app = electron.app
const Menu = electron.Menu
const ipc = electron.ipcMain const ipc = electron.ipcMain
const globalShortcut = electron.globalShortcut const globalShortcut = electron.globalShortcut
const jetpack = require('fs-jetpack') const jetpack = require('fs-jetpack')
const path = require('path')
const mainWindow = require('./atom-lib/main-window') const mainWindow = require('./atom-lib/main-window')
const nodeIpc = require('@rokt33r/node-ipc') const nodeIpc = require('@rokt33r/node-ipc')

View File

@@ -12,7 +12,7 @@ var opt = {
publicPath: 'http://localhost:8080/assets/' publicPath: 'http://localhost:8080/assets/'
} }
config = { var config = {
module: { module: {
loaders: [ loaders: [
{ {