@@ -5,8 +5,6 @@ const archiver = require('archiver')
55const fs = require ( 'fs' )
66
77module . exports = function ( grunt ) {
8-
9- // Project configuration.
108 grunt . initConfig ( {
119 pkg : grunt . file . readJSON ( 'package.json' ) ,
1210 auth_code : grunt . file . readJSON ( 'secret/auth_code.json' ) ,
@@ -25,38 +23,45 @@ module.exports = function (grunt) {
2523 }
2624 }
2725 } )
26+
2827 grunt . loadNpmTasks ( 'grunt-electron-installer' )
2928
3029 grunt . registerTask ( 'compile' , function ( ) {
3130 var done = this . async ( )
3231 var execPath = path . join ( 'node_modules' , '.bin' , 'webpack' ) + ' --config webpack.config.production.js'
3332 grunt . log . writeln ( execPath )
34- var compileProcess = ChildProcess . exec ( execPath ,
33+ ChildProcess . exec ( execPath ,
3534 {
3635 env : Object . assign ( { } , process . env , {
3736 BABEL_ENV : 'production'
3837 } )
39- } , function ( err , stdout , stderr ) {
40- grunt . log . writeln ( stdout )
41- if ( err ) {
42- grunt . log . writeln ( err )
43- grunt . log . writeln ( stderr )
44- done ( false )
45- return
38+ } ,
39+ function ( err , stdout , stderr ) {
40+ grunt . log . writeln ( stdout )
41+
42+ if ( err ) {
43+ grunt . log . writeln ( err )
44+ grunt . log . writeln ( stderr )
45+ done ( false )
46+ return
47+ }
48+ done ( )
4649 }
47- done ( )
48- } )
50+ )
4951 } )
5052
5153 grunt . registerTask ( 'zip' , function ( platform ) {
5254 var done = this . async ( )
5355 var archive = archiver . create ( 'zip' , { } )
5456 switch ( platform ) {
5557 case 'win' :
56- archive . file ( path . join ( 'dist/Setup.exe' ) , { name :'Boostnote-installer-win32-x64.exe' } )
58+ archive . file ( path . join ( 'dist/Setup.exe' ) , {
59+ name : 'Boostnote-installer-win32-x64.exe'
60+ } )
61+ break
5762 default :
5863 done ( )
59- return
64+ break
6065 }
6166 archive . finalize ( )
6267 var writeStream = fs . createWriteStream ( path . join ( 'dist/Boostnote-installer-win32-x64.zip' ) )
0 commit comments