1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-15 10:46:32 +00:00

no zip for windows & must compile before release app

This commit is contained in:
Rokt33r
2015-12-22 21:56:37 +09:00
parent 93d99c0c47
commit f3ce4ca803

View File

@@ -1,7 +1,6 @@
const path = require('path') const path = require('path')
const ChildProcess = require('child_process') const ChildProcess = require('child_process')
const packager = require('electron-packager') const packager = require('electron-packager')
const archiver = require('archiver')
const fs = require('fs') const fs = require('fs')
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
const appdmg = require('appdmg') const appdmg = require('appdmg')
@@ -57,23 +56,8 @@ module.exports = function (grunt) {
grunt.registerTask('zip', function (platform) { grunt.registerTask('zip', function (platform) {
var done = this.async() var done = this.async()
switch (platform) { switch (platform) {
case 'win':
var archive = archiver.create('zip', {})
var basename = 'Boostnote-installer-win32-x64'
archive.file(path.join('dist/Setup.exe'), {
name: basename + '.exe'
})
archive.finalize()
var writeStream = fs.createWriteStream(path.join('dist/' + basename + '.zip'))
archive.pipe(writeStream)
writeStream.on('close', function () {
grunt.log.writeln('Zipped!')
done()
})
break
case 'osx': case 'osx':
var execPath = 'cd dist/Boostnote-darwin-x64 && zip -r -y -q ../Boostnote-mac.zip Boostnote.app'
var execPath = 'zip -r -y -q dist/Boostnote.zip dist/Boostnote-darwin-x64/Boostnote.app'
grunt.log.writeln(execPath) grunt.log.writeln(execPath)
ChildProcess.exec(execPath, ChildProcess.exec(execPath,
function (err, stdout, stderr) { function (err, stdout, stderr) {
@@ -178,7 +162,7 @@ module.exports = function (grunt) {
var done = this.async() var done = this.async()
var stream = appdmg({ var stream = appdmg({
target: 'dist/Boostnote-darwin-x64.dmg', target: 'dist/Boostnote-mac.dmg',
basepath: __dirname, basepath: __dirname,
specification: { specification: {
'title': 'Boostnote', 'title': 'Boostnote',
@@ -207,10 +191,10 @@ module.exports = function (grunt) {
} }
switch (platform) { switch (platform) {
case 'win': case 'win':
grunt.task.run(['pack:win', 'create-windows-installer', 'zip:win']) grunt.task.run(['compile', 'pack:win', 'create-windows-installer'])
break break
case 'osx': case 'osx':
grunt.task.run(['pack:osx', 'codesign', 'create-osx-installer', 'zip:osx']) grunt.task.run(['compile', 'pack:osx', 'codesign', 'create-osx-installer', 'zip:osx'])
break break
} }
}) })