Skip to content

Commit f3ce4ca

Browse files
committed
no zip for windows & must compile before release app
1 parent 93d99c0 commit f3ce4ca

1 file changed

Lines changed: 4 additions & 20 deletions

File tree

gruntfile.js

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const path = require('path')
22
const ChildProcess = require('child_process')
33
const packager = require('electron-packager')
4-
const archiver = require('archiver')
54
const fs = require('fs')
65
if (process.platform === 'darwin') {
76
const appdmg = require('appdmg')
@@ -57,23 +56,8 @@ module.exports = function (grunt) {
5756
grunt.registerTask('zip', function (platform) {
5857
var done = this.async()
5958
switch (platform) {
60-
case 'win':
61-
var archive = archiver.create('zip', {})
62-
var basename = 'Boostnote-installer-win32-x64'
63-
archive.file(path.join('dist/Setup.exe'), {
64-
name: basename + '.exe'
65-
})
66-
archive.finalize()
67-
var writeStream = fs.createWriteStream(path.join('dist/' + basename + '.zip'))
68-
archive.pipe(writeStream)
69-
writeStream.on('close', function () {
70-
grunt.log.writeln('Zipped!')
71-
done()
72-
})
73-
break
7459
case 'osx':
75-
76-
var execPath = 'zip -r -y -q dist/Boostnote.zip dist/Boostnote-darwin-x64/Boostnote.app'
60+
var execPath = 'cd dist/Boostnote-darwin-x64 && zip -r -y -q ../Boostnote-mac.zip Boostnote.app'
7761
grunt.log.writeln(execPath)
7862
ChildProcess.exec(execPath,
7963
function (err, stdout, stderr) {
@@ -178,7 +162,7 @@ module.exports = function (grunt) {
178162
var done = this.async()
179163

180164
var stream = appdmg({
181-
target: 'dist/Boostnote-darwin-x64.dmg',
165+
target: 'dist/Boostnote-mac.dmg',
182166
basepath: __dirname,
183167
specification: {
184168
'title': 'Boostnote',
@@ -207,10 +191,10 @@ module.exports = function (grunt) {
207191
}
208192
switch (platform) {
209193
case 'win':
210-
grunt.task.run(['pack:win', 'create-windows-installer', 'zip:win'])
194+
grunt.task.run(['compile', 'pack:win', 'create-windows-installer'])
211195
break
212196
case 'osx':
213-
grunt.task.run(['pack:osx', 'codesign', 'create-osx-installer', 'zip:osx'])
197+
grunt.task.run(['compile', 'pack:osx', 'codesign', 'create-osx-installer', 'zip:osx'])
214198
break
215199
}
216200
})

0 commit comments

Comments
 (0)