From 9af0ca6f5da010f27f89040e3ae54259e216613a Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sun, 29 Apr 2018 20:46:11 +0700 Subject: [PATCH] Make the default output name for humans No longer replaces spaces in the DMG name with dashes. --- cli.js | 2 +- fixture.app/Contents/Info.plist | 4 +++- readme.md | 2 +- test.js | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/cli.js b/cli.js index 6414216..2be2aa1 100755 --- a/cli.js +++ b/cli.js @@ -48,7 +48,7 @@ try { const appInfo = plist.parse(infoPlist); const appName = appInfo.CFBundleName; // `const appIconName = appInfo.CFBundleIconFile.replace(/\.icns/, ''); -const dmgPath = path.join(destPath, `${appName.replace(/ /g, '-')}-${appInfo.CFBundleShortVersionString}.dmg`); +const dmgPath = path.join(destPath, `${appName} ${appInfo.CFBundleShortVersionString}.dmg`); const ora = new Ora('Creating DMG'); ora.start(); diff --git a/fixture.app/Contents/Info.plist b/fixture.app/Contents/Info.plist index 1490323..12a016c 100644 --- a/fixture.app/Contents/Info.plist +++ b/fixture.app/Contents/Info.plist @@ -15,7 +15,9 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - fixture + Fixture + LSApplicationCategoryType + CFBundlePackageType APPL CFBundleShortVersionString diff --git a/readme.md b/readme.md index 2ec8168..a76857d 100644 --- a/readme.md +++ b/readme.md @@ -38,7 +38,7 @@ $ create-dmg --help ## DMG -The DMG requires macOS 10.11 or later and has the filename `appName-appVersion.dmg`, for example `Lungo-1.0.0.dmg`. +The DMG requires macOS 10.11 or later and has the filename `App Name 0.0.0.dmg`, for example `Lungo 1.0.0.dmg`. It will try to code sign the DMG, but the DMG is still created and fine even if the code signing fails, for example if you don't have a developer certificate. diff --git a/test.js b/test.js index 1e8fdf7..79d9b91 100644 --- a/test.js +++ b/test.js @@ -16,5 +16,5 @@ test('main', async t => { } } - t.true(fs.existsSync(path.join(cwd, 'fixture-0.0.1.dmg'))); + t.true(fs.existsSync(path.join(cwd, 'Fixture 0.0.1.dmg'))); });