Skip to content

Commit

Permalink
feat(maker-pkg): allow to override .pkg name (#1785)
Browse files Browse the repository at this point in the history
Co-authored-by: Erick Zhao <[email protected]>
Co-authored-by: Black-Hole <[email protected]>
  • Loading branch information
3 people authored Nov 14, 2022
1 parent 75462be commit e9b4576
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/maker/pkg/src/Config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
export interface MakerPKGConfig {
/**
* The application name.
*
* Default: `${appName}-${packageJSON.version}-${targetArch}`.
*/
name?: string;
/**
* Name of certificate to use when signing.
*
Expand Down
3 changes: 2 additions & 1 deletion packages/maker/pkg/src/MakerPKG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default class MakerPKG extends MakerBase<MakerPKGConfig> {
throw new Error(`The pkg maker only supports targeting "mas" and "darwin" builds. You provided "${targetPlatform}".`);
}

const outPath = path.resolve(makeDir, `${appName}-${packageJSON.version}-${targetArch}.pkg`);
const name = this.config.name || `${appName}-${packageJSON.version}-${targetArch}`;
const outPath = path.resolve(makeDir, `${name}.pkg`);

await this.ensureFile(outPath);

Expand Down

0 comments on commit e9b4576

Please sign in to comment.