Skip to content

Commit

Permalink
artifactId instead of artifactID and add to env cmd (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiGuranIonos authored Mar 9, 2023
1 parent 2f402d9 commit 045b56c
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 12 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/commands/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: ''}),
}
Expand All @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/commands/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/models/gen-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class GenConfig {
build = true
noCache = false
packageName = 'ionoscloud'
artifactID = ''
artifactId = ''

public forceAbsPaths() {
if (!this.assetsDir.startsWith('/')) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/open-api-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')

]

Expand Down
2 changes: 1 addition & 1 deletion src/services/sdk-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down

0 comments on commit 045b56c

Please sign in to comment.