Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ const cli = meow(`
--overwrite Overwrite existing DMG with the same name
--identity=<value> Manually set code signing identity (automatic by default)
--dmg-title=<value> Manually set DMG title (must be <=27 characters) [default: App name]
-o, --output=<value> Output path for the DMG file

Examples
$ create-dmg 'Lungo.app'
$ create-dmg 'Lungo.app' Build/Releases
$ create-dmg 'Lungo.app' --output='MyApp.dmg'
`, {
importMeta: import.meta,
flags: {
Expand All @@ -42,6 +44,10 @@ const cli = meow(`
dmgTitle: {
type: 'string',
},
output: {
type: 'string',
shortFlag: 'o',
},
},
});

Expand Down Expand Up @@ -88,8 +94,8 @@ async function init() {
}

const dmgTitle = cli.flags.dmgTitle ?? appName;
const dmgFilename = `${appName} ${appInfo.CFBundleShortVersionString}.dmg`;
const dmgPath = path.join(destinationPath, dmgFilename);
const dmgPath = cli.flags.output ?? path.join(destinationPath, `${appName} ${appInfo.CFBundleShortVersionString}.dmg`);
const dmgFilename = path.basename(dmgPath);

if (dmgTitle.length > 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');
Expand Down
Loading