Skip to content

Commit adb35b5

Browse files
committed
clean up package
1 parent acead09 commit adb35b5

3 files changed

Lines changed: 26 additions & 30 deletions

File tree

appdmg.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"title": "Boostnote",
3+
"icon": "resources/dmg.icns",
4+
"background": "resources/boostnote-install.png",
5+
"icon-size": 80,
6+
"contents": [
7+
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
8+
{ "x": 192, "y": 344, "type": "file", "path": "dist/Boostnote-darwin-x64/Boostnote.app" }
9+
]
10+
11+
}

gruntfile.js

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
const path = require('path')
22
const ChildProcess = require('child_process')
33
const packager = require('electron-packager')
4-
const appdmg = process.platform === 'darwin'
5-
? require('appdmg')
6-
: null
74

85
module.exports = function (grunt) {
96
var auth_code
@@ -76,7 +73,7 @@ module.exports = function (grunt) {
7673
prune: true,
7774
overwrite: true,
7875
out: path.join(__dirname, 'dist'),
79-
ignore: /submodules\/ace\/(?!src-min)|submodules\/ace\/(?=src-min-noconflict)|node_modules\/devicon\/icons|dist|^\/browser|^\/secret|\.babelrc|\.gitignore|^\/\.gitmodules|^\/gruntfile|^\/readme.md|^\/webpack/
76+
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/
8077
}
8178
switch (platform) {
8279
case 'win':
@@ -143,29 +140,19 @@ module.exports = function (grunt) {
143140

144141
grunt.registerTask('create-osx-installer', function () {
145142
var done = this.async()
146-
147-
var stream = appdmg({
148-
target: 'dist/Boostnote-mac.dmg',
149-
basepath: __dirname,
150-
specification: {
151-
'title': 'Boostnote',
152-
'icon': 'resources/dmg.icns',
153-
'background': 'resources/boostnote-install.png',
154-
'icon-size': 80,
155-
'contents': [
156-
{ 'x': 448, 'y': 344, 'type': 'link', 'path': '/Applications' },
157-
{ 'x': 192, 'y': 344, 'type': 'file', 'path': 'dist/Boostnote-darwin-x64/Boostnote.app' }
158-
]
159-
}
160-
})
161-
stream.on('finish', function () {
162-
done()
163-
})
164-
165-
stream.on('error', function (err) {
166-
grunt.log.writeln(err)
167-
done(false)
168-
})
143+
var execPath = 'appdmg appdmg.json dist/Boostnote-mac.dmg'
144+
grunt.log.writeln(execPath)
145+
ChildProcess.exec(execPath,
146+
function (err, stdout, stderr) {
147+
grunt.log.writeln(stdout)
148+
if (err) {
149+
grunt.log.writeln(err)
150+
grunt.log.writeln(stderr)
151+
done(false)
152+
return
153+
}
154+
done()
155+
})
169156
})
170157

171158
grunt.registerTask('zip', function (platform) {

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@
7272
"webpack": "^1.12.2",
7373
"webpack-dev-server": "^1.12.0"
7474
},
75-
"optionalDependencies": {
76-
"appdmg": "^0.3.5"
77-
},
75+
"optionalDependencies": {},
7876
"standard": {
7977
"ignore": [],
8078
"globals": [

0 commit comments

Comments
 (0)