diff --git a/cmd/apis/apis.go b/cmd/apis/apis.go index 7d979b85f..343299b5f 100644 --- a/cmd/apis/apis.go +++ b/cmd/apis/apis.go @@ -30,6 +30,8 @@ var ( conn, revision int ) +const zipExt = ".zip" + func init() { Cmd.PersistentFlags().StringVarP(&org, "org", "o", "", "Apigee organization name") diff --git a/cmd/apis/bundlecrtapis.go b/cmd/apis/bundlecrtapis.go index 14e4a42af..323b72bf9 100644 --- a/cmd/apis/bundlecrtapis.go +++ b/cmd/apis/bundlecrtapis.go @@ -63,7 +63,7 @@ var BundleCreateCmd = &cobra.Command{ } defer os.RemoveAll(tmpDir) - proxyBundlePath := path.Join(tmpDir, name+".zip") + proxyBundlePath := path.Join(tmpDir, name+zipExt) if err = proxybundle.GenerateArchiveBundle(proxyFolder, proxyBundlePath, false); err != nil { return err diff --git a/cmd/apis/cloneapi.go b/cmd/apis/cloneapi.go index 158c43d0c..924f1fd1c 100644 --- a/cmd/apis/cloneapi.go +++ b/cmd/apis/cloneapi.go @@ -79,7 +79,7 @@ var CloneCmd = &cobra.Command{ return err } - proxyBundlePath := path.Join(tmpDir, name+".zip") + proxyBundlePath := path.Join(tmpDir, name+zipExt) if err = proxybundle.GenerateArchiveBundle(path.Join(tmpDir, "apiproxy"), proxyBundlePath, false); err != nil { return err diff --git a/cmd/apis/depapi.go b/cmd/apis/depapi.go index 5735330fe..d812271f7 100644 --- a/cmd/apis/depapi.go +++ b/cmd/apis/depapi.go @@ -73,11 +73,10 @@ var DepCmd = &cobra.Command{ return true } else if respMap["state"] == "READY" { clilog.Info.Println("Proxy deployment completed with status: ", respMap["state"]) - return false } else { clilog.Info.Println("Proxy deployment failed with status: ", respMap["state"]) - return false } + return false }) <-stop diff --git a/cmd/apis/gqlcrtapis.go b/cmd/apis/gqlcrtapis.go index 9b7d3463c..d4930718c 100644 --- a/cmd/apis/gqlcrtapis.go +++ b/cmd/apis/gqlcrtapis.go @@ -97,7 +97,7 @@ var GqlCreateCmd = &cobra.Command{ } if importProxy { - _, err = apis.CreateProxy(name, name+".zip") + _, err = apis.CreateProxy(name, name+zipExt) } return err diff --git a/cmd/apis/oascrtapis.go b/cmd/apis/oascrtapis.go index 1e123e999..18fb0b4f9 100644 --- a/cmd/apis/oascrtapis.go +++ b/cmd/apis/oascrtapis.go @@ -113,7 +113,7 @@ var OasCreateCmd = &cobra.Command{ } if importProxy { - _, err = apis.CreateProxy(name, name+".zip") + _, err = apis.CreateProxy(name, name+zipExt) } return err diff --git a/cmd/apis/swaggerapis.go b/cmd/apis/swaggerapis.go index cfa93dcb3..5caee770c 100644 --- a/cmd/apis/swaggerapis.go +++ b/cmd/apis/swaggerapis.go @@ -69,7 +69,7 @@ var SwaggerCreateCmd = &cobra.Command{ addCORS) if importProxy { - _, err = apis.CreateProxy(name, name+".zip") + _, err = apis.CreateProxy(name, name+zipExt) } return err diff --git a/cmd/env/crtarchive.go b/cmd/env/crtarchive.go index afe9627b6..5b50ab60c 100644 --- a/cmd/env/crtarchive.go +++ b/cmd/env/crtarchive.go @@ -105,11 +105,10 @@ var CreateArchiveCmd = &cobra.Command{ } else { clilog.Info.Printf("Archive deployment failed with status: %s", respMap.Error.Message) } - return false } else { clilog.Info.Printf("Unknown state %s", respMap.Metadata.State) - return false } + return false }) <-stop diff --git a/cmd/sharedflows/depsf.go b/cmd/sharedflows/depsf.go index 578b8fa28..2295b12e3 100644 --- a/cmd/sharedflows/depsf.go +++ b/cmd/sharedflows/depsf.go @@ -64,11 +64,10 @@ var DepCmd = &cobra.Command{ return true } else if respMap["state"] == "READY" { clilog.Info.Println("Sharedflow deployment completed with status: ", respMap["state"]) - return false } else { clilog.Info.Println("Sharedflow deployment failed with status: ", respMap["state"]) - return false } + return false }) <-stop