Skip to content

Commit

Permalink
Merge pull request #106 from LinusU/optional-icon-size
Browse files Browse the repository at this point in the history
Make icon-size optional
  • Loading branch information
cstruct committed May 22, 2016
2 parents df77c2c + 17bb31f commit 19abd27
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 8 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ the JSON file's path.
"title": "Test Application",
"icon": "test-app.icns",
"background": "test-background.png",
"icon-size": 80,
"contents": [
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
{ "x": 192, "y": 344, "type": "file", "path": "TestApp.app" }
Expand All @@ -53,7 +52,7 @@ the JSON file's path.
+ `icon` (string, optional) - Path to your icon, which will be shown when mounted
+ `background` (string, optional) - Path to your background
+ `background-color` (string, optional) - Background color (accepts css colors)
+ `icon-size` (string, required) - Size of all the icons inside the DMG
+ `icon-size` (string, optional) - Size of all the icons inside the DMG
+ `window` (object, optional) - Window options
+ `position` (object, optional) - Position when opened
+ `x` (number, required) - X position relative to bottom of the screen
Expand Down
2 changes: 1 addition & 1 deletion lib/appdmg.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ module.exports = exports = function (options) {
var ds = new DSStore()

ds.vSrn(1)
ds.setIconSize(global.opts['icon-size'])
ds.setIconSize(global.opts['icon-size'] || 80)

if (global.opts['background-color']) {
var rgb = parseColor(global.opts['background-color']).rgb
Expand Down
1 change: 0 additions & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
},
"required": [
"title",
"icon-size",
"contents"
]
}
2 changes: 0 additions & 2 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ describe('api', function () {
title: 'Test Title',
icon: 'TestIcon.icns',
background: 'TestBkg.png',
'icon-size': 80,
contents: [
{ x: 448, y: 344, type: 'link', path: '/Applications' },
{ x: 192, y: 344, type: 'file', path: 'TestApp.app' },
Expand Down Expand Up @@ -118,7 +117,6 @@ describe('api', function () {
icon: 'TestIcon.icns',
background: 'TestBkg.png',
format: 'UDRO',
'icon-size': 80,
contents: [
{ x: 448, y: 344, type: 'link', path: '/Applications' },
{ x: 192, y: 344, type: 'file', path: 'TestApp.app' },
Expand Down
1 change: 0 additions & 1 deletion test/assets/appdmg-bg-color.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Test Title",
"icon": "TestIcon.icns",
"background-color": "mintcream",
"icon-size": 80,
"contents": [
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
{ "x": 192, "y": 344, "type": "file", "path": "TestApp.app" },
Expand Down
1 change: 0 additions & 1 deletion test/assets/appdmg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"title": "Test Title",
"icon": "TestIcon.icns",
"background": "TestBkg.png",
"icon-size": 80,
"contents": [
{ "x": 448, "y": 344, "type": "link", "path": "/Applications" },
{ "x": 192, "y": 344, "type": "file", "path": "TestApp.app" },
Expand Down

0 comments on commit 19abd27

Please sign in to comment.