Skip to content

Commit 6ac2602

Browse files
committed
feat: source convert uses api version when it exists
1 parent f79390f commit 6ac2602

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

messages/convert.source.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ To specify a package name that includes spaces, enclose the name in single quote
2020

2121
$ <%= config.bin %> <%= command.id %> --root-dir path/to/source --output-dir path/to/outputdir --package-name 'My Package'
2222

23+
# flags.api-version.summary
24+
25+
API Version to use in the generated project's manifest. By default, will use the version from sfdx-project.json
26+
2327
# flags.root-dir.summary
2428

2529
Source directory other than the default package to convert.

src/commands/project/convert/source.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class Source extends SfCommand<ConvertResultJson> {
3939
public static readonly aliases = ['force:source:convert'];
4040
public static readonly deprecateAliases = true;
4141
public static readonly flags = {
42-
'api-version': orgApiVersionFlagWithDeprecations,
42+
'api-version': { ...orgApiVersionFlagWithDeprecations, summary: messages.getMessage('flags.api-version.summary') },
4343
loglevel,
4444
'root-dir': Flags.directory({
4545
aliases: ['rootdir'],
@@ -117,7 +117,7 @@ export class Source extends SfCommand<ConvertResultJson> {
117117
}
118118

119119
this.componentSet = await ComponentSetBuilder.build({
120-
sourceapiversion: await getSourceApiVersion(),
120+
sourceapiversion: this.flags['api-version'] ?? (await getSourceApiVersion()),
121121
sourcepath: paths,
122122
manifest: manifest
123123
? {

0 commit comments

Comments
 (0)