Skip to content

Commit 0940626

Browse files
authoredAug 19, 2022
fix: list all valid targets in documentation for --target (#766)
Fixes: #763
1 parent 27fad23 commit 0940626

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed
 

‎src/main.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import program from 'commander';
22
import leven from 'leven';
3-
import { packageCommand, ls } from './package';
3+
import { packageCommand, ls, Targets } from './package';
44
import { publish, unpublish } from './publish';
55
import { show } from './show';
66
import { search } from './search';
@@ -55,6 +55,8 @@ function main(task: Promise<any>): void {
5555
});
5656
}
5757

58+
const ValidTargets = [...Targets].join(', ');
59+
5860
module.exports = function (argv: string[]): void {
5961
program.version(pkg.version).usage('<command>');
6062

@@ -81,7 +83,7 @@ module.exports = function (argv: string[]): void {
8183
.command('package [version]')
8284
.description('Packages an extension')
8385
.option('-o, --out <path>', 'Output .vsix extension file to <path> location (defaults to <name>-<version>.vsix)')
84-
.option('-t, --target <target>', 'Target architecture')
86+
.option('-t, --target <target>', `Target architecture. Valid targets: ${ValidTargets}`)
8587
.option('-m, --message <commit message>', 'Commit message used when calling `npm version`.')
8688
.option(
8789
'--no-git-tag-version',
@@ -167,7 +169,7 @@ module.exports = function (argv: string[]): void {
167169
'Personal Access Token (defaults to VSCE_PAT environment variable)',
168170
process.env['VSCE_PAT']
169171
)
170-
.option('-t, --target <targets...>', 'Target architectures')
172+
.option('-t, --target <targets...>', `Target architectures. Valid targets: ${ValidTargets}`)
171173
.option('-m, --message <commit message>', 'Commit message used when calling `npm version`.')
172174
.option(
173175
'--no-git-tag-version',

‎src/package.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ export async function versionBump(options: IVersionBumpOptions): Promise<void> {
350350
}
351351
}
352352

353-
const Targets = new Set([
353+
export const Targets = new Set([
354354
'win32-x64',
355355
'win32-ia32',
356356
'win32-arm64',

0 commit comments

Comments
 (0)
Please sign in to comment.