1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-11 00:36:26 +00:00

clean up package

This commit is contained in:
Rokt33r
2016-01-10 06:46:20 +09:00
parent acead09377
commit adb35b5bef
3 changed files with 26 additions and 30 deletions

11
appdmg.json Normal file
View File

@@ -0,0 +1,11 @@
{
"title": "Boostnote",
"icon": "resources/dmg.icns",
"background": "resources/boostnote-install.png",
"icon-size": 80,
"contents": [
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
{ "x": 192, "y": 344, "type": "file", "path": "dist/Boostnote-darwin-x64/Boostnote.app" }
]
}

View File

@@ -1,9 +1,6 @@
const path = require('path')
const ChildProcess = require('child_process')
const packager = require('electron-packager')
const appdmg = process.platform === 'darwin'
? require('appdmg')
: null
module.exports = function (grunt) {
var auth_code
@@ -76,7 +73,7 @@ module.exports = function (grunt) {
prune: true,
overwrite: true,
out: path.join(__dirname, 'dist'),
ignore: /submodules\/ace\/(?!src-min)|submodules\/ace\/(?=src-min-noconflict)|node_modules\/devicon\/icons|dist|^\/browser|^\/secret|\.babelrc|\.gitignore|^\/\.gitmodules|^\/gruntfile|^\/readme.md|^\/webpack/
ignore: /submodules\/ace\/(?!src-min)|submodules\/ace\/(?=src-min-noconflict)|node_modules\/devicon\/icons|dist|^\/browser|^\/secret|\.babelrc|\.gitignore|^\/\.gitmodules|^\/gruntfile|^\/readme.md|^\/webpack|^\/appdmg\.json/
}
switch (platform) {
case 'win':
@@ -143,29 +140,19 @@ module.exports = function (grunt) {
grunt.registerTask('create-osx-installer', function () {
var done = this.async()
var stream = appdmg({
target: 'dist/Boostnote-mac.dmg',
basepath: __dirname,
specification: {
'title': 'Boostnote',
'icon': 'resources/dmg.icns',
'background': 'resources/boostnote-install.png',
'icon-size': 80,
'contents': [
{ 'x': 448, 'y': 344, 'type': 'link', 'path': '/Applications' },
{ 'x': 192, 'y': 344, 'type': 'file', 'path': 'dist/Boostnote-darwin-x64/Boostnote.app' }
]
}
})
stream.on('finish', function () {
done()
})
stream.on('error', function (err) {
grunt.log.writeln(err)
done(false)
})
var execPath = 'appdmg appdmg.json dist/Boostnote-mac.dmg'
grunt.log.writeln(execPath)
ChildProcess.exec(execPath,
function (err, stdout, stderr) {
grunt.log.writeln(stdout)
if (err) {
grunt.log.writeln(err)
grunt.log.writeln(stderr)
done(false)
return
}
done()
})
})
grunt.registerTask('zip', function (platform) {

View File

@@ -72,9 +72,7 @@
"webpack": "^1.12.2",
"webpack-dev-server": "^1.12.0"
},
"optionalDependencies": {
"appdmg": "^0.3.5"
},
"optionalDependencies": {},
"standard": {
"ignore": [],
"globals": [