From 045b56c5a44b9ccda1f351d439bb4a3577d9621c Mon Sep 17 00:00:00 2001 From: cguran-ionos Date: Thu, 9 Mar 2023 17:22:06 +0200 Subject: [PATCH] artifactId instead of artifactID and add to env cmd (#12) --- CHANGELOG.md | 7 ++++++- README.md | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- src/commands/env.ts | 3 ++- src/commands/generate.ts | 4 ++-- src/models/gen-config.ts | 2 +- src/services/open-api-gen.ts | 2 +- src/services/sdk-assets.ts | 2 +- 9 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 21485bd..327eb0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ +## 1.2.6 + +- add `artifactId` optional flag to env cmd also + + ## 1.2.5 -- add `artifactID` optional flag to be able to pass the artifactID +- add `artifactId` optional flag to be able to pass the artifactId ## 1.2.4 diff --git a/README.md b/README.md index cb6a078..a676695 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ OPTIONS -h, --help show CLI help -n, --name=name (required) sdk to build -p, --package=packageName sdk package name - -i, --artifactID=artifactID artifact id + -i, --artifactId=artifactId artifact id -o, --output-dir=output-dir output dir -s, --spec=spec [default: none.json] api spec -v, --version=version [default: 0.0.0] sdk version @@ -87,7 +87,7 @@ OPTIONS -h, --help show CLI help -n, --name=name (required) sdk to build -p, --package=packageName sdk package name - -i, --artifactID=artifactID artifact id + -i, --artifactId=artifactId artifact id -o, --output-dir=output-dir output dir -s, --spec=spec (required) api spec -v, --version=version (required) sdk version diff --git a/package-lock.json b/package-lock.json index 95fdcf5..d765342 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@ionos-cloud/ionossdk", - "version": "1.2.5", + "version": "1.2.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@ionos-cloud/ionossdk", - "version": "1.2.5", + "version": "1.2.6", "license": "MIT", "dependencies": { "@oclif/command": "^1.8.0", diff --git a/package.json b/package.json index 51c79ba..31d2592 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@ionos-cloud/ionossdk", "description": "Ionos Cloud SDK tool", - "version": "1.2.5", + "version": "1.2.6", "author": "Florin Mihalache", "bin": { "ionossdk": "./bin/run" diff --git a/src/commands/env.ts b/src/commands/env.ts index cf681eb..a54f665 100644 --- a/src/commands/env.ts +++ b/src/commands/env.ts @@ -14,6 +14,7 @@ export default class Env extends BaseCommand { version: flags.string({char: 'v', description: 'sdk version', required: false, default: '0.0.0'}), name: flags.string({char: 'n', description: 'sdk to build', required: true}), package: flags.string({char: 'p', description: 'sdk package name', required: false}), + artifactId: flags.string({char: 'i', description: 'artifact id', required: false}), 'assets-dir': flags.string({char: 'a', description: 'sdk assets directory (templates, scripts etc)', required: true}), 'output-dir': flags.string({char: 'o', description: 'output dir', required: false, default: ''}), } @@ -30,7 +31,7 @@ export default class Env extends BaseCommand { genConfig.specFile = this.flags.spec genConfig.sdkName = this.flags.name genConfig.packageName = this.flags.package || 'ionoscloud' - genConfig.artifactID = this.flags.artifactID + genConfig.artifactId = this.flags.artifactId /* convert to absolute paths to avoid errors when changing dirs to run commands */ genConfig.forceAbsPaths() diff --git a/src/commands/generate.ts b/src/commands/generate.ts index 8550436..9c509c3 100644 --- a/src/commands/generate.ts +++ b/src/commands/generate.ts @@ -14,7 +14,7 @@ export default class Generate extends BaseCommand { version: flags.string({char: 'v', description: 'sdk version', required: true}), name: flags.string({char: 'n', description: 'sdk to build', required: true}), package: flags.string({char: 'p', description: 'sdk package name', required: false}), - artifactID: flags.string({char: 'i', description: 'artifact id', required: false}), + artifactId: flags.string({char: 'i', description: 'artifact id', required: false}), 'assets-dir': flags.string({char: 'a', description: 'sdk assets directory (templates, scripts etc)'}), 'output-dir': flags.string({char: 'o', description: 'output dir'}), build: flags.boolean({char: 'b', description: 'also build the sdk with the build.sh script', default: true}), @@ -35,7 +35,7 @@ export default class Generate extends BaseCommand { genConfig.build = this.flags.build genConfig.noCache = this.flags['no-cache'] genConfig.packageName = this.flags.package || 'ionoscloud' - genConfig.artifactID = this.flags.artifactID + genConfig.artifactId = this.flags.artifactId /* convert to absolute paths to avoid errors when changing dirs to run commands */ genConfig.forceAbsPaths() diff --git a/src/models/gen-config.ts b/src/models/gen-config.ts index 0ef1f38..b24c3e5 100644 --- a/src/models/gen-config.ts +++ b/src/models/gen-config.ts @@ -9,7 +9,7 @@ export class GenConfig { build = true noCache = false packageName = 'ionoscloud' - artifactID = '' + artifactId = '' public forceAbsPaths() { if (!this.assetsDir.startsWith('/')) { diff --git a/src/services/open-api-gen.ts b/src/services/open-api-gen.ts index 1f43b8e..b2b19c9 100644 --- a/src/services/open-api-gen.ts +++ b/src/services/open-api-gen.ts @@ -51,7 +51,7 @@ export class OpenApiGen { '--git-user-id', vars.get('repoOwner'), '--git-repo-id', vars.get('repoId'), '--package-name', vars.get('packageName'), - '--artifact-id', vars.get('artifactID') + '--artifact-id', vars.get('artifactId') ] diff --git a/src/services/sdk-assets.ts b/src/services/sdk-assets.ts index a34f7d2..a7e3a98 100644 --- a/src/services/sdk-assets.ts +++ b/src/services/sdk-assets.ts @@ -45,7 +45,7 @@ export class SdkAssets { outputDir: genConfig.outputDir, httpUserAgent: `ionos-cloud-sdk-${genConfig.sdkName}/v${genConfig.version}`, packageName: genConfig.packageName, - artifactID: genConfig.artifactID, + artifactId: genConfig.artifactId, repoId: `${genConfig.sdkName}`, repoOwner: DEFAULT_REPO_OWNER, repo: `https://github.com/${DEFAULT_REPO_OWNER}/${genConfig.sdkName}`,