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

[TA-2785] List variables command #168

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

LaberionAjvazi
Copy link
Contributor

@LaberionAjvazi LaberionAjvazi commented Jan 26, 2024

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

  • I have self-reviewed this PR
  • I have tested the change and proved that it works in different scenarios
  • I have updated docs if needed

jetakasabaqi
jetakasabaqi previously approved these changes Jan 29, 2024
# 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
src/commands/config.command.ts Show resolved Hide resolved
@LaberionAjvazi LaberionAjvazi merged commit c80248a into master Jan 31, 2024
1 check passed
private async buildKeyVersionPairs(keysByVersion: string[], keysByVersionFile: string): Promise<PackageKeyAndVersionPair[]> {
let variablesExportRequest: PackageKeyAndVersionPair[] = [];

if (keysByVersion.length) {
Copy link
Contributor

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.

Suggested change
if (keysByVersion.length) {
if (keysByVersion.length !== 0) {

expect(variableExportRequest).toEqual(packageKeyAndVersionPairs);
})

it("Should throw error if no mapping or file path is provided", async () => {
Copy link
Contributor

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) {
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

6 participants