Skip to content

Commit

Permalink
feat: add 'target' argument when packing/uploading windows (#1181)
Browse files Browse the repository at this point in the history
  • Loading branch information
otaviojacobi committed Sep 5, 2023
1 parent b666e26 commit d0df8b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/commands/pack/win.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,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 pack (e.g.: win32-x64,win32-x86)',
}),
}

async run(): Promise<void> {
await this.checkForNSIS()
const {flags} = await this.parse(PackWin)
const buildConfig = await Tarballs.buildConfig(flags.root)
const buildConfig = await Tarballs.buildConfig(flags.root, {targets: flags?.targets?.split(',')})
const {config} = buildConfig
await Tarballs.build(buildConfig, {platform: 'win32', pack: false, tarball: flags.tarball, parallel: true})
const arches = buildConfig.targets.filter(t => t.platform === 'win32').map(t => t.arch)
Expand Down
3 changes: 2 additions & 1 deletion src/commands/upload/win.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ export default class UploadWin extends Command {

static flags = {
root: Flags.string({char: 'r', description: 'path to oclif CLI root', default: '.', required: true}),
targets: Flags.string({description: 'comma-separated targets to pack (e.g.: win32-x64,win32-x86)'}),
}

async run(): Promise<void> {
const {flags} = await this.parse(UploadWin)
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!,
Expand Down

0 comments on commit d0df8b4

Please sign in to comment.