Remove 27-character minimum threshold to use --dmg-title (#49)

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
This commit is contained in:
sart bimpson 2020-04-23 13:01:03 +05:30 committed by GitHub
parent 60f21bcde6
commit 127b692941
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

9
cli.js
View File

@ -22,7 +22,7 @@ const cli = meow(`
Options
--overwrite Overwrite existing DMG with the same name
--identity=<value> Manually set code signing identity (automatic by default)
--dmg-title=<value> Manually set title of DMG volume (only used if app name is >27 character limit)
--dmg-title=<value> Manually set DMG title (must be <=27 characters) [default: App name]
Examples
$ create-dmg 'Lungo.app'
@ -79,9 +79,14 @@ async function init() {
}
const appName = appInfo.CFBundleDisplayName || appInfo.CFBundleName;
const dmgTitle = appName.length > 27 ? (cli.flags.dmgTitle || appName) : appName;
const dmgTitle = cli.flags.dmgTitle || appName;
const dmgPath = path.join(destinationPath, `${appName} ${appInfo.CFBundleShortVersionString}.dmg`);
if (dmgTitle > 27) {
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');
process.exit(1);
}
if (cli.flags.overwrite) {
try {
fs.unlinkSync(dmgPath);

View File

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