From 364238f1541540bb2e135b56a87ad9962acd649c Mon Sep 17 00:00:00 2001 From: Manjunath Date: Mon, 4 Nov 2024 14:20:37 +0100 Subject: [PATCH] handle error while fetching working directory (#5168) --- cmd/abapAddonAssemblyKitCheckCVs_generated.go | 7 +++++-- cmd/abapAddonAssemblyKitCheckPV_generated.go | 7 +++++-- cmd/abapAddonAssemblyKitCheck_generated.go | 7 +++++-- cmd/abapAddonAssemblyKitCreateTargetVector_generated.go | 7 +++++-- cmd/abapAddonAssemblyKitPublishTargetVector_generated.go | 7 +++++-- cmd/abapAddonAssemblyKitRegisterPackages_generated.go | 7 +++++-- cmd/abapAddonAssemblyKitReleasePackages_generated.go | 7 +++++-- cmd/abapAddonAssemblyKitReserveNextPackages_generated.go | 7 +++++-- cmd/abapEnvironmentAssembleConfirm_generated.go | 7 +++++-- cmd/abapEnvironmentAssemblePackages_generated.go | 7 +++++-- cmd/abapEnvironmentBuild_generated.go | 7 +++++-- cmd/abapEnvironmentCheckoutBranch_generated.go | 7 +++++-- cmd/abapEnvironmentCloneGitRepo_generated.go | 7 +++++-- cmd/abapEnvironmentCreateSystem_generated.go | 7 +++++-- cmd/abapEnvironmentCreateTag_generated.go | 7 +++++-- cmd/abapEnvironmentPullGitRepo_generated.go | 7 +++++-- cmd/abapEnvironmentPushATCSystemConfig_generated.go | 7 +++++-- cmd/abapEnvironmentRunATCCheck_generated.go | 7 +++++-- cmd/abapEnvironmentRunAUnitTest_generated.go | 7 +++++-- cmd/abapLandscapePortalUpdateAddOnProduct_generated.go | 7 +++++-- cmd/ansSendEvent_generated.go | 7 +++++-- cmd/apiKeyValueMapDownload_generated.go | 7 +++++-- cmd/apiKeyValueMapUpload_generated.go | 7 +++++-- cmd/apiProviderDownload_generated.go | 7 +++++-- cmd/apiProviderList_generated.go | 7 +++++-- cmd/apiProviderUpload_generated.go | 7 +++++-- cmd/apiProxyDownload_generated.go | 7 +++++-- cmd/apiProxyList_generated.go | 7 +++++-- cmd/apiProxyUpload_generated.go | 7 +++++-- cmd/artifactPrepareVersion_generated.go | 7 +++++-- cmd/ascAppUpload_generated.go | 7 +++++-- cmd/awsS3Upload_generated.go | 7 +++++-- cmd/azureBlobUpload_generated.go | 7 +++++-- cmd/batsExecuteTests_generated.go | 7 +++++-- cmd/checkmarxExecuteScan_generated.go | 7 +++++-- cmd/checkmarxOneExecuteScan_generated.go | 7 +++++-- cmd/cloudFoundryCreateServiceKey_generated.go | 7 +++++-- cmd/cloudFoundryCreateService_generated.go | 7 +++++-- cmd/cloudFoundryCreateSpace_generated.go | 7 +++++-- cmd/cloudFoundryDeleteService_generated.go | 7 +++++-- cmd/cloudFoundryDeleteSpace_generated.go | 7 +++++-- cmd/cloudFoundryDeploy_generated.go | 7 +++++-- cmd/cnbBuild_generated.go | 7 +++++-- cmd/codeqlExecuteScan_generated.go | 7 +++++-- cmd/containerExecuteStructureTests_generated.go | 7 +++++-- cmd/containerSaveImage_generated.go | 7 +++++-- cmd/contrastExecuteScan_generated.go | 7 +++++-- cmd/credentialdiggerScan_generated.go | 7 +++++-- cmd/detectExecuteScan_generated.go | 7 +++++-- cmd/fortifyExecuteScan_generated.go | 7 +++++-- cmd/gaugeExecuteTests_generated.go | 7 +++++-- cmd/gcpPublishEvent_generated.go | 7 +++++-- cmd/gctsCloneRepository_generated.go | 7 +++++-- cmd/gctsCreateRepository_generated.go | 7 +++++-- cmd/gctsDeploy_generated.go | 7 +++++-- cmd/gctsExecuteABAPQualityChecks_generated.go | 7 +++++-- cmd/gctsExecuteABAPUnitTests_generated.go | 7 +++++-- cmd/gctsRollback_generated.go | 7 +++++-- cmd/githubCheckBranchProtection_generated.go | 7 +++++-- cmd/githubCommentIssue_generated.go | 7 +++++-- cmd/githubCreateIssue_generated.go | 7 +++++-- cmd/githubCreatePullRequest_generated.go | 7 +++++-- cmd/githubPublishRelease_generated.go | 7 +++++-- cmd/githubSetCommitStatus_generated.go | 7 +++++-- cmd/gitopsUpdateDeployment_generated.go | 7 +++++-- cmd/golangBuild_generated.go | 7 +++++-- cmd/gradleExecuteBuild_generated.go | 7 +++++-- cmd/hadolintExecute_generated.go | 7 +++++-- cmd/helmExecute_generated.go | 7 +++++-- cmd/imagePushToRegistry_generated.go | 7 +++++-- cmd/influxWriteData_generated.go | 7 +++++-- cmd/integrationArtifactDeploy_generated.go | 7 +++++-- cmd/integrationArtifactDownload_generated.go | 7 +++++-- cmd/integrationArtifactGetMplStatus_generated.go | 7 +++++-- cmd/integrationArtifactGetServiceEndpoint_generated.go | 7 +++++-- cmd/integrationArtifactResource_generated.go | 7 +++++-- cmd/integrationArtifactTransport_generated.go | 7 +++++-- cmd/integrationArtifactTriggerIntegrationTest_generated.go | 7 +++++-- cmd/integrationArtifactUnDeploy_generated.go | 7 +++++-- cmd/integrationArtifactUpdateConfiguration_generated.go | 7 +++++-- cmd/integrationArtifactUpload_generated.go | 7 +++++-- cmd/isChangeInDevelopment_generated.go | 7 +++++-- cmd/jsonApplyPatch_generated.go | 7 +++++-- cmd/kanikoExecute_generated.go | 7 +++++-- cmd/karmaExecuteTests_generated.go | 7 +++++-- cmd/kubernetesDeploy_generated.go | 7 +++++-- cmd/malwareExecuteScan_generated.go | 7 +++++-- cmd/mavenBuild_generated.go | 7 +++++-- cmd/mavenExecuteIntegration_generated.go | 7 +++++-- cmd/mavenExecuteStaticCodeChecks_generated.go | 7 +++++-- cmd/mavenExecute_generated.go | 7 +++++-- cmd/mtaBuild_generated.go | 7 +++++-- cmd/newmanExecute_generated.go | 7 +++++-- cmd/nexusUpload_generated.go | 7 +++++-- cmd/npmExecuteLint_generated.go | 7 +++++-- cmd/npmExecuteScripts_generated.go | 7 +++++-- cmd/pipelineCreateScanSummary_generated.go | 7 +++++-- cmd/protecodeExecuteScan_generated.go | 7 +++++-- cmd/pythonBuild_generated.go | 7 +++++-- cmd/shellExecute_generated.go | 7 +++++-- cmd/sonarExecuteScan_generated.go | 7 +++++-- cmd/terraformExecute_generated.go | 7 +++++-- cmd/tmsExport_generated.go | 7 +++++-- cmd/tmsUpload_generated.go | 7 +++++-- cmd/transportRequestDocIDFromGit_generated.go | 7 +++++-- cmd/transportRequestReqIDFromGit_generated.go | 7 +++++-- cmd/transportRequestUploadCTS_generated.go | 7 +++++-- cmd/transportRequestUploadRFC_generated.go | 7 +++++-- cmd/transportRequestUploadSOLMAN_generated.go | 7 +++++-- cmd/uiVeri5ExecuteTests_generated.go | 7 +++++-- cmd/vaultRotateSecretId_generated.go | 7 +++++-- cmd/whitesourceExecuteScan_generated.go | 7 +++++-- cmd/xsDeploy_generated.go | 7 +++++-- pkg/generator/helper/helper.go | 7 +++++-- .../helper/testdata/TestProcessMetaFiles/README.md | 1 + .../TestProcessMetaFiles/custom_step_code_generated.golden | 7 +++++-- .../TestProcessMetaFiles/step_code_generated.golden | 7 +++++-- 117 files changed, 581 insertions(+), 232 deletions(-) create mode 100644 pkg/generator/helper/testdata/TestProcessMetaFiles/README.md diff --git a/cmd/abapAddonAssemblyKitCheckCVs_generated.go b/cmd/abapAddonAssemblyKitCheckCVs_generated.go index 651d25e833..9f1af748f1 100644 --- a/cmd/abapAddonAssemblyKitCheckCVs_generated.go +++ b/cmd/abapAddonAssemblyKitCheckCVs_generated.go @@ -84,11 +84,14 @@ For Terminology refer to the [Scenario Description](https://www.project-piper.io GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapAddonAssemblyKitCheckPV_generated.go b/cmd/abapAddonAssemblyKitCheckPV_generated.go index c3d4ac2206..68cbc03785 100644 --- a/cmd/abapAddonAssemblyKitCheckPV_generated.go +++ b/cmd/abapAddonAssemblyKitCheckPV_generated.go @@ -84,11 +84,14 @@ For Terminology refer to the [Scenario Description](https://www.project-piper.io GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapAddonAssemblyKitCheck_generated.go b/cmd/abapAddonAssemblyKitCheck_generated.go index 0dec1e978e..6bf2fc877c 100644 --- a/cmd/abapAddonAssemblyKitCheck_generated.go +++ b/cmd/abapAddonAssemblyKitCheck_generated.go @@ -86,11 +86,14 @@ For Terminology refer to the [Scenario Description](https://www.project-piper.io GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapAddonAssemblyKitCreateTargetVector_generated.go b/cmd/abapAddonAssemblyKitCreateTargetVector_generated.go index 2d237e7764..92dfb268f2 100644 --- a/cmd/abapAddonAssemblyKitCreateTargetVector_generated.go +++ b/cmd/abapAddonAssemblyKitCreateTargetVector_generated.go @@ -85,11 +85,14 @@ For Terminology refer to the [Scenario Description](https://www.project-piper.io GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapAddonAssemblyKitPublishTargetVector_generated.go b/cmd/abapAddonAssemblyKitPublishTargetVector_generated.go index 87de4808af..3b99470eb7 100644 --- a/cmd/abapAddonAssemblyKitPublishTargetVector_generated.go +++ b/cmd/abapAddonAssemblyKitPublishTargetVector_generated.go @@ -56,11 +56,14 @@ For Terminology refer to the [Scenario Description](https://www.project-piper.io GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapAddonAssemblyKitRegisterPackages_generated.go b/cmd/abapAddonAssemblyKitRegisterPackages_generated.go index 3d2eeffa73..71cdfd42bb 100644 --- a/cmd/abapAddonAssemblyKitRegisterPackages_generated.go +++ b/cmd/abapAddonAssemblyKitRegisterPackages_generated.go @@ -86,11 +86,14 @@ For Terminology refer to the [Scenario Description](https://www.project-piper.io GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapAddonAssemblyKitReleasePackages_generated.go b/cmd/abapAddonAssemblyKitReleasePackages_generated.go index ca9f78c1fc..2a363fc4e9 100644 --- a/cmd/abapAddonAssemblyKitReleasePackages_generated.go +++ b/cmd/abapAddonAssemblyKitReleasePackages_generated.go @@ -86,11 +86,14 @@ For Terminology refer to the [Scenario Description](https://www.project-piper.io GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapAddonAssemblyKitReserveNextPackages_generated.go b/cmd/abapAddonAssemblyKitReserveNextPackages_generated.go index 58f6e627b4..7d48f492b1 100644 --- a/cmd/abapAddonAssemblyKitReserveNextPackages_generated.go +++ b/cmd/abapAddonAssemblyKitReserveNextPackages_generated.go @@ -90,11 +90,14 @@ For Terminology refer to the [Scenario Description](https://www.project-piper.io GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentAssembleConfirm_generated.go b/cmd/abapEnvironmentAssembleConfirm_generated.go index 9b7bfafdc2..b7f6880a97 100644 --- a/cmd/abapEnvironmentAssembleConfirm_generated.go +++ b/cmd/abapEnvironmentAssembleConfirm_generated.go @@ -83,11 +83,14 @@ func AbapEnvironmentAssembleConfirmCommand() *cobra.Command { GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentAssemblePackages_generated.go b/cmd/abapEnvironmentAssemblePackages_generated.go index e9ac906aaf..adfb53fea4 100644 --- a/cmd/abapEnvironmentAssemblePackages_generated.go +++ b/cmd/abapEnvironmentAssemblePackages_generated.go @@ -85,11 +85,14 @@ Platform ABAP Environment system and saves the corresponding [SAR archive](https GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentBuild_generated.go b/cmd/abapEnvironmentBuild_generated.go index c87a380f8d..85a20bc2b5 100644 --- a/cmd/abapEnvironmentBuild_generated.go +++ b/cmd/abapEnvironmentBuild_generated.go @@ -98,11 +98,14 @@ func AbapEnvironmentBuildCommand() *cobra.Command { GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentCheckoutBranch_generated.go b/cmd/abapEnvironmentCheckoutBranch_generated.go index 06fc95284f..342b11225e 100644 --- a/cmd/abapEnvironmentCheckoutBranch_generated.go +++ b/cmd/abapEnvironmentCheckoutBranch_generated.go @@ -59,11 +59,14 @@ Please provide either of the following options: GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentCloneGitRepo_generated.go b/cmd/abapEnvironmentCloneGitRepo_generated.go index c8759f5b83..e1da421535 100644 --- a/cmd/abapEnvironmentCloneGitRepo_generated.go +++ b/cmd/abapEnvironmentCloneGitRepo_generated.go @@ -62,11 +62,14 @@ Please provide either of the following options: GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentCreateSystem_generated.go b/cmd/abapEnvironmentCreateSystem_generated.go index 9928abc03c..7cf1d951f8 100644 --- a/cmd/abapEnvironmentCreateSystem_generated.go +++ b/cmd/abapEnvironmentCreateSystem_generated.go @@ -58,11 +58,14 @@ func AbapEnvironmentCreateSystemCommand() *cobra.Command { GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentCreateTag_generated.go b/cmd/abapEnvironmentCreateTag_generated.go index 22e9260669..2d0a2daa30 100644 --- a/cmd/abapEnvironmentCreateTag_generated.go +++ b/cmd/abapEnvironmentCreateTag_generated.go @@ -62,11 +62,14 @@ Please provide either of the following options: GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentPullGitRepo_generated.go b/cmd/abapEnvironmentPullGitRepo_generated.go index 05cc2a0c21..d763185c8d 100644 --- a/cmd/abapEnvironmentPullGitRepo_generated.go +++ b/cmd/abapEnvironmentPullGitRepo_generated.go @@ -61,11 +61,14 @@ Please provide either of the following options: GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentPushATCSystemConfig_generated.go b/cmd/abapEnvironmentPushATCSystemConfig_generated.go index c33c2d9eb9..ad1834feda 100644 --- a/cmd/abapEnvironmentPushATCSystemConfig_generated.go +++ b/cmd/abapEnvironmentPushATCSystemConfig_generated.go @@ -56,11 +56,14 @@ Please provide either of the following options: GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentRunATCCheck_generated.go b/cmd/abapEnvironmentRunATCCheck_generated.go index 04a52ad14d..43983a3115 100644 --- a/cmd/abapEnvironmentRunATCCheck_generated.go +++ b/cmd/abapEnvironmentRunATCCheck_generated.go @@ -61,11 +61,14 @@ Regardless of the option you chose, please make sure to provide the configuratio GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapEnvironmentRunAUnitTest_generated.go b/cmd/abapEnvironmentRunAUnitTest_generated.go index a3e865cd2d..19e35e7f5d 100644 --- a/cmd/abapEnvironmentRunAUnitTest_generated.go +++ b/cmd/abapEnvironmentRunAUnitTest_generated.go @@ -60,11 +60,14 @@ Regardless of the option you chose, please make sure to provide the object set c GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/abapLandscapePortalUpdateAddOnProduct_generated.go b/cmd/abapLandscapePortalUpdateAddOnProduct_generated.go index a44196072b..6be7825b22 100644 --- a/cmd/abapLandscapePortalUpdateAddOnProduct_generated.go +++ b/cmd/abapLandscapePortalUpdateAddOnProduct_generated.go @@ -44,11 +44,14 @@ func AbapLandscapePortalUpdateAddOnProductCommand() *cobra.Command { GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/ansSendEvent_generated.go b/cmd/ansSendEvent_generated.go index 9993c7745a..3f4e002034 100644 --- a/cmd/ansSendEvent_generated.go +++ b/cmd/ansSendEvent_generated.go @@ -53,11 +53,14 @@ func AnsSendEventCommand() *cobra.Command { GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/apiKeyValueMapDownload_generated.go b/cmd/apiKeyValueMapDownload_generated.go index 2ced0e9124..d69d948a8e 100644 --- a/cmd/apiKeyValueMapDownload_generated.go +++ b/cmd/apiKeyValueMapDownload_generated.go @@ -45,11 +45,14 @@ Learn more about the SAP API Management API for downloading an Key Value Map art GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/apiKeyValueMapUpload_generated.go b/cmd/apiKeyValueMapUpload_generated.go index c62d559b3f..75e0456bf8 100644 --- a/cmd/apiKeyValueMapUpload_generated.go +++ b/cmd/apiKeyValueMapUpload_generated.go @@ -46,11 +46,14 @@ Learn more about the SAP API Management API for creating an API key value map ar GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/apiProviderDownload_generated.go b/cmd/apiProviderDownload_generated.go index def4eb576c..b972acde58 100644 --- a/cmd/apiProviderDownload_generated.go +++ b/cmd/apiProviderDownload_generated.go @@ -44,11 +44,14 @@ func ApiProviderDownloadCommand() *cobra.Command { GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/apiProviderList_generated.go b/cmd/apiProviderList_generated.go index 76ce80c0f1..cb9ee968b2 100644 --- a/cmd/apiProviderList_generated.go +++ b/cmd/apiProviderList_generated.go @@ -81,11 +81,14 @@ func ApiProviderListCommand() *cobra.Command { GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/apiProviderUpload_generated.go b/cmd/apiProviderUpload_generated.go index 1b1728099f..daf844d013 100644 --- a/cmd/apiProviderUpload_generated.go +++ b/cmd/apiProviderUpload_generated.go @@ -44,11 +44,14 @@ Learn more about API Management api for creating an API provider artifact [here] GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/apiProxyDownload_generated.go b/cmd/apiProxyDownload_generated.go index 7f0238202b..0cae8c928b 100644 --- a/cmd/apiProxyDownload_generated.go +++ b/cmd/apiProxyDownload_generated.go @@ -44,11 +44,14 @@ func ApiProxyDownloadCommand() *cobra.Command { GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/apiProxyList_generated.go b/cmd/apiProxyList_generated.go index 53f8c86d7b..2f4a2e2e96 100644 --- a/cmd/apiProxyList_generated.go +++ b/cmd/apiProxyList_generated.go @@ -81,11 +81,14 @@ func ApiProxyListCommand() *cobra.Command { GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/apiProxyUpload_generated.go b/cmd/apiProxyUpload_generated.go index 51bf6c42a1..f8036b1407 100644 --- a/cmd/apiProxyUpload_generated.go +++ b/cmd/apiProxyUpload_generated.go @@ -44,11 +44,14 @@ Learn more about the SAP API Management API for uploading an api proxy artifact GeneralConfig.GitHubAccessTokens = ResolveAccessTokens(GeneralConfig.GitHubTokens) - path, _ := os.Getwd() + path, err := os.Getwd() + if err != nil { + return err + } fatalHook := &log.FatalHook{CorrelationID: GeneralConfig.CorrelationID, Path: path} log.RegisterHook(fatalHook) - err := PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) + err = PrepareConfig(cmd, &metadata, STEP_NAME, &stepConfig, config.OpenPiperFile) if err != nil { log.SetErrorCategory(log.ErrorConfiguration) return err diff --git a/cmd/artifactPrepareVersion_generated.go b/cmd/artifactPrepareVersion_generated.go index e39872d89b..24e29a34d1 100644 --- a/cmd/artifactPrepareVersion_generated.go +++ b/cmd/artifactPrepareVersion_generated.go @@ -172,11 +172,14 @@ Define ` + "`" + `buildTool: custom` + "`" + `, ` + "`" + `filePath: --install --force --namespace