Skip to content

Commit 127b692

Browse files
kwvgsindresorhus
andauthored
Remove 27-character minimum threshold to use --dmg-title (#49)
Co-authored-by: Sindre Sorhus <[email protected]>
1 parent 60f21bc commit 127b692

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

cli.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const cli = meow(`
2222
Options
2323
--overwrite Overwrite existing DMG with the same name
2424
--identity=<value> Manually set code signing identity (automatic by default)
25-
--dmg-title=<value> Manually set title of DMG volume (only used if app name is >27 character limit)
25+
--dmg-title=<value> Manually set DMG title (must be <=27 characters) [default: App name]
2626
2727
Examples
2828
$ create-dmg 'Lungo.app'
@@ -79,9 +79,14 @@ async function init() {
7979
}
8080

8181
const appName = appInfo.CFBundleDisplayName || appInfo.CFBundleName;
82-
const dmgTitle = appName.length > 27 ? (cli.flags.dmgTitle || appName) : appName;
82+
const dmgTitle = cli.flags.dmgTitle || appName;
8383
const dmgPath = path.join(destinationPath, `${appName} ${appInfo.CFBundleShortVersionString}.dmg`);
8484

85+
if (dmgTitle > 27) {
86+
ora.fail('The disk image title cannot exceed 27 characters. This is a limitation in a dependency: https://github.com/LinusU/node-alias/issues/7');
87+
process.exit(1);
88+
}
89+
8590
if (cli.flags.overwrite) {
8691
try {
8792
fs.unlinkSync(dmgPath);

readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $ create-dmg --help
2727
Options
2828
--overwrite Overwrite existing DMG with the same name
2929
--identity=<value> Manually set code signing identity (automatic by default)
30-
--dmg-title=<value> Manually set title of DMG volume (only used if app name is >27 character limit)
30+
--dmg-title=<value> Manually set DMG title (must be <=27 characters) [default: App name]
3131
3232
Examples
3333
$ create-dmg 'Lungo.app'

0 commit comments

Comments
 (0)