Skip to content

Commit

Permalink
fix(maker-pkg): add targetArch to pkg name (#3057)
Browse files Browse the repository at this point in the history
Co-authored-by: Narayan Sainaney <narayan@sainaney.com>
  • Loading branch information
erickzhao and nsainaney authored Nov 9, 2022
1 parent 5559449 commit 344a0af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/maker/pkg/src/MakerPKG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export default class MakerPKG extends MakerBase<MakerPKGConfig> {
return process.platform === 'darwin';
}

async make({ dir, makeDir, appName, packageJSON, targetPlatform }: MakerOptions): Promise<string[]> {
async make({ dir, makeDir, appName, packageJSON, targetPlatform, targetArch }: MakerOptions): Promise<string[]> {
if (!this.isValidTargetPlatform(targetPlatform)) {
throw new Error(`The pkg maker only supports targeting "mas" and "darwin" builds. You provided "${targetPlatform}".`);
}

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

await this.ensureFile(outPath);

Expand Down
2 changes: 1 addition & 1 deletion packages/maker/pkg/test/MakerPKG_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ describe('MakerPKG', () => {
const opts = osxSignStub.firstCall.args[0];
expect(opts).to.deep.equal({
app: path.resolve(`${dir}/My Test App.app`),
pkg: path.resolve(`${dir.substr(0, dir.length - 4)}/make/My Test App-1.2.3.pkg`),
pkg: path.resolve(`${dir.substr(0, dir.length - 4)}/make/My Test App-1.2.3-${targetArch}.pkg`),
platform: 'mas',
});
});
Expand Down

0 comments on commit 344a0af

Please sign in to comment.