From e9b457667ed5886c74efb55e08f4bf7344a991f7 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Mon, 14 Nov 2022 21:14:47 +0400 Subject: [PATCH] feat(maker-pkg): allow to override .pkg name (#1785) Co-authored-by: Erick Zhao Co-authored-by: Black-Hole <158blackhole@gmail.com> --- packages/maker/pkg/src/Config.ts | 6 ++++++ packages/maker/pkg/src/MakerPKG.ts | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/maker/pkg/src/Config.ts b/packages/maker/pkg/src/Config.ts index 189ee76ddb..0163a664b3 100644 --- a/packages/maker/pkg/src/Config.ts +++ b/packages/maker/pkg/src/Config.ts @@ -1,4 +1,10 @@ export interface MakerPKGConfig { + /** + * The application name. + * + * Default: `${appName}-${packageJSON.version}-${targetArch}`. + */ + name?: string; /** * Name of certificate to use when signing. * diff --git a/packages/maker/pkg/src/MakerPKG.ts b/packages/maker/pkg/src/MakerPKG.ts index aa155d39ad..da28845166 100644 --- a/packages/maker/pkg/src/MakerPKG.ts +++ b/packages/maker/pkg/src/MakerPKG.ts @@ -20,7 +20,8 @@ export default class MakerPKG extends MakerBase { 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);