Make the default output name for humans

No longer replaces spaces in the DMG name with dashes.
This commit is contained in:
Sindre Sorhus 2018-04-29 20:46:11 +07:00
parent 8655c20ed9
commit 9af0ca6f5d
4 changed files with 6 additions and 4 deletions

2
cli.js
View File

@ -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();

View File

@ -15,7 +15,9 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>fixture</string>
<string>Fixture</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>

View File

@ -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.

View File

@ -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')));
});