Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: list all valid targets in documentation for --target #766

Merged
merged 2 commits into from Aug 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/main.ts
@@ -1,6 +1,6 @@
import program from 'commander';
import leven from 'leven';
import { packageCommand, ls } from './package';
import { packageCommand, ls, Targets } from './package';
import { publish, unpublish } from './publish';
import { show } from './show';
import { search } from './search';
Expand Down Expand Up @@ -55,6 +55,8 @@ function main(task: Promise<any>): void {
});
}

const ValidTargets = [...Targets].join(', ');

module.exports = function (argv: string[]): void {
program.version(pkg.version).usage('<command>');

Expand All @@ -81,7 +83,7 @@ module.exports = function (argv: string[]): void {
.command('package [version]')
.description('Packages an extension')
.option('-o, --out <path>', 'Output .vsix extension file to <path> location (defaults to <name>-<version>.vsix)')
.option('-t, --target <target>', 'Target architecture')
.option('-t, --target <target>', `Target architecture. Valid targets: ${ValidTargets}`)
.option('-m, --message <commit message>', 'Commit message used when calling `npm version`.')
.option(
'--no-git-tag-version',
Expand Down Expand Up @@ -167,7 +169,7 @@ module.exports = function (argv: string[]): void {
'Personal Access Token (defaults to VSCE_PAT environment variable)',
process.env['VSCE_PAT']
)
.option('-t, --target <targets...>', 'Target architectures')
.option('-t, --target <targets...>', `Target architectures. Valid targets: ${ValidTargets}`)
.option('-m, --message <commit message>', 'Commit message used when calling `npm version`.')
.option(
'--no-git-tag-version',
Expand Down
2 changes: 1 addition & 1 deletion src/package.ts
Expand Up @@ -350,7 +350,7 @@ export async function versionBump(options: IVersionBumpOptions): Promise<void> {
}
}

const Targets = new Set([
export const Targets = new Set([
'win32-x64',
'win32-ia32',
'win32-arm64',
Expand Down