mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 01:36:22 +00:00
cleanup code
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
const electron = require('electron')
|
||||
const app = electron.app
|
||||
const Menu = electron.Menu
|
||||
const ipcMain = electron.ipcMain
|
||||
const path = require('path')
|
||||
|
||||
var finderWindow = null
|
||||
|
||||
@@ -24,4 +22,3 @@ app.on('ready', function () {
|
||||
finderWindow.hide()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
33
gruntfile.js
33
gruntfile.js
@@ -5,8 +5,6 @@ const archiver = require('archiver')
|
||||
const fs = require('fs')
|
||||
|
||||
module.exports = function (grunt) {
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
auth_code: grunt.file.readJSON('secret/auth_code.json'),
|
||||
@@ -25,27 +23,31 @@ module.exports = function (grunt) {
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
grunt.loadNpmTasks('grunt-electron-installer')
|
||||
|
||||
grunt.registerTask('compile', function () {
|
||||
var done = this.async()
|
||||
var execPath = path.join('node_modules', '.bin', 'webpack') + ' --config webpack.config.production.js'
|
||||
grunt.log.writeln(execPath)
|
||||
var compileProcess = ChildProcess.exec(execPath,
|
||||
ChildProcess.exec(execPath,
|
||||
{
|
||||
env: Object.assign({}, process.env, {
|
||||
BABEL_ENV: 'production'
|
||||
})
|
||||
}, function (err, stdout, stderr) {
|
||||
grunt.log.writeln(stdout)
|
||||
if (err) {
|
||||
grunt.log.writeln(err)
|
||||
grunt.log.writeln(stderr)
|
||||
done(false)
|
||||
return
|
||||
},
|
||||
function (err, stdout, stderr) {
|
||||
grunt.log.writeln(stdout)
|
||||
|
||||
if (err) {
|
||||
grunt.log.writeln(err)
|
||||
grunt.log.writeln(stderr)
|
||||
done(false)
|
||||
return
|
||||
}
|
||||
done()
|
||||
}
|
||||
done()
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
grunt.registerTask('zip', function (platform) {
|
||||
@@ -53,10 +55,13 @@ module.exports = function (grunt) {
|
||||
var archive = archiver.create('zip', {})
|
||||
switch (platform) {
|
||||
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:
|
||||
done()
|
||||
return
|
||||
break
|
||||
}
|
||||
archive.finalize()
|
||||
var writeStream = fs.createWriteStream(path.join('dist/Boostnote-installer-win32-x64.zip'))
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
const electron = require('electron')
|
||||
const app = electron.app
|
||||
const Menu = electron.Menu
|
||||
const ipc = electron.ipcMain
|
||||
const globalShortcut = electron.globalShortcut
|
||||
const jetpack = require('fs-jetpack')
|
||||
const path = require('path')
|
||||
const mainWindow = require('./atom-lib/main-window')
|
||||
const nodeIpc = require('@rokt33r/node-ipc')
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ var opt = {
|
||||
publicPath: 'http://localhost:8080/assets/'
|
||||
}
|
||||
|
||||
config = {
|
||||
var config = {
|
||||
module: {
|
||||
loaders: [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user