mirror of
https://github.com/status-im/create-dmg.git
synced 2025-02-19 22:38:15 +00:00
parent
370b6ceab5
commit
1d1a1eaa27
17
cli.js
17
cli.js
@ -17,10 +17,19 @@ const cli = meow(`
|
||||
Usage
|
||||
$ create-dmg <app> [destination]
|
||||
|
||||
Options
|
||||
--overwrite Overwrite existing DMG with the same name
|
||||
|
||||
Examples
|
||||
$ create-dmg 'Lungo.app'
|
||||
$ create-dmg 'Lungo.app' Build/Releases
|
||||
`);
|
||||
`, {
|
||||
flags: {
|
||||
overwrite: {
|
||||
type: 'boolean'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let [appPath, destPath] = cli.input;
|
||||
|
||||
@ -53,6 +62,12 @@ const dmgPath = path.join(destPath, `${appName} ${appInfo.CFBundleShortVersionSt
|
||||
const ora = new Ora('Creating DMG');
|
||||
ora.start();
|
||||
|
||||
if (cli.flags.overwrite) {
|
||||
try {
|
||||
fs.unlinkSync(dmgPath);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
const ee = appdmg({
|
||||
target: dmgPath,
|
||||
basepath: __dirname,
|
||||
|
Loading…
x
Reference in New Issue
Block a user