Skip to content

Commit

Permalink
fix: format of --api-version parameter (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
scolladon authored Jan 9, 2025
1 parent f99eec6 commit ce699b2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion docs/migrating-to-v6.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Version `v6.0.0` brings the plugin into the **sf plugin v2 architecture**, which
- [Plugin output format changes](#default-output)
- [Streamlined JSON output](#json-output)
- [Switch to ES modules (no more CommonJS)](#export-module)
- [API version format](#api-version-format)
- [Setting LogLevel](#setting-log-level)

## Installation Details
Expand Down Expand Up @@ -167,8 +168,18 @@ Here’s is how to import the plugin:
import sgd from 'sfdx-git-delta'
```

### <a name="api-version-format"></a> API version format

Previously, the plugin accepted API versions using the -a or --api-version parameter in two formats:
- Integer (e.g., `62`)
- Float (e.g., `62.0`)

Now it uses the [`orgApiVersionFlag`](https://github.com/salesforcecli/sf-plugins-core/blob/43c7203a55ed2fa063d2bff3b62dfd16b37410ce/src/flags/orgApiVersion.ts#L39) standard flag and only accept floats ending with `.0` (e.g., `62.0`)
Providing an integer will result in an error:
_"62 is not a valid API version. It should end in '.0' like '54.0'."_

### <a name="setting-log-level"></a> Setting LogLevel

Previously with `sfdx/cli` LogLevel was set using the `--loglevel` parameter. It is deprecated, you cannot set the loglevel this way anymore.
Now with the `salesforce/cli` LogLevel is set with the [SF_LOG_LEVEL environment variable](https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/
sfdx_dev_cli_log_messages.htm)
sfdx_dev_cli_log_messages.htm)
4 changes: 2 additions & 2 deletions src/commands/sgd/source/delta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default class SourceDeltaGenerate extends SfCommand<SgdResult> {
char: 'W',
summary: messages.getMessage('flags.ignore-whitespace.summary'),
}),
'api-version': Flags.integer({
'api-version': Flags.orgApiVersion({
char: 'a',
summary: messages.getMessage('flags.api-version.summary'),
}),
Expand Down Expand Up @@ -121,7 +121,7 @@ export default class SourceDeltaGenerate extends SfCommand<SgdResult> {
const { flags } = await this.parse(SourceDeltaGenerate)

const config: Config = {
apiVersion: flags['api-version'],
apiVersion: parseInt(flags['api-version']!) || undefined,
from: flags['from'],
generateDelta: flags['generate-delta'],
ignore: flags['ignore-file'],
Expand Down

0 comments on commit ce699b2

Please sign in to comment.