From b4adf48ab4071e775aaeeddbc4cf7a5d79c8275d Mon Sep 17 00:00:00 2001 From: Matt Webb Date: Mon, 21 Nov 2022 23:51:31 -0800 Subject: [PATCH] feat: add 'target' argument when packing/uploading macOS --- src/commands/pack/macos.ts | 5 ++++- src/commands/upload/macos.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/commands/pack/macos.ts b/src/commands/pack/macos.ts index c374859b3..8fdd78e71 100644 --- a/src/commands/pack/macos.ts +++ b/src/commands/pack/macos.ts @@ -141,12 +141,15 @@ the CLI should already exist in a directory named after the CLI that is the root description: 'optionally specify a path to a tarball already generated by NPM', required: false, }), + targets: Flags.string({ + description: 'comma-separated targets to upload (e.g.: darwin-x64, darwin-arm64)', + }), } async run(): Promise { if (process.platform !== 'darwin') this.error('must be run from macos') const {flags} = await this.parse(PackMacos) - const buildConfig = await Tarballs.buildConfig(flags.root) + const buildConfig = await Tarballs.buildConfig(flags.root, {targets: flags?.targets?.split(',')}) const {config} = buildConfig const c = config.pjson.oclif as OclifConfig if (!c.macos) this.error('package.json is missing an oclif.macos config') diff --git a/src/commands/upload/macos.ts b/src/commands/upload/macos.ts index 61490b5ad..e6c17642d 100644 --- a/src/commands/upload/macos.ts +++ b/src/commands/upload/macos.ts @@ -13,11 +13,12 @@ export default class UploadMacos extends Command { static flags = { root: Flags.string({char: 'r', description: 'path to oclif CLI root', default: '.', required: true}), + targets: Flags.string({char: 't', description: 'comma-separated targets to upload (e.g.: darwin-x64, darwin-arm64)'}), } async run(): Promise { const {flags} = await this.parse(UploadMacos) - const buildConfig = await Tarballs.buildConfig(flags.root) + const buildConfig = await Tarballs.buildConfig(flags.root, {targets: flags?.targets?.split(',')}) const {s3Config, config, dist} = buildConfig const S3Options = { Bucket: s3Config.bucket!,