-
Notifications
You must be signed in to change notification settings - Fork 5
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
[TA-2785] List variables command #168
Conversation
# Conflicts: # src/api/batch-import-export-api.ts # src/commands/config.command.ts # src/content-cli-config.ts # src/interfaces/package-export-transport.ts # src/services/studio/studio.service.ts
private async buildKeyVersionPairs(keysByVersion: string[], keysByVersionFile: string): Promise<PackageKeyAndVersionPair[]> { | ||
let variablesExportRequest: PackageKeyAndVersionPair[] = []; | ||
|
||
if (keysByVersion.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please compare numbers to numbers. I think it makes it more explicit what we are comparing, instead of relying on truthy values.
if (keysByVersion.length) { | |
if (keysByVersion.length !== 0) { |
expect(variableExportRequest).toEqual(packageKeyAndVersionPairs); | ||
}) | ||
|
||
it("Should throw error if no mapping or file path is provided", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the test name should be Should throw error if no mapping and no file path is provided
|
||
if (keysByVersion.length) { | ||
variablesExportRequest = this.buildKeyAndVersionPairsFromArrayInput(keysByVersion); | ||
} else if (!keysByVersion.length && keysByVersionFile.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think keysByVersionFile.length
should be keysByVersionFile !== ""
, right?
Description
Added command to list variables for packages by key and version.
The command can be used to list package variables for given keys and version. It has an optional --json param which can be used to export the variables as json instead of just listing in the console.
Checklist