File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,19 @@ import (
2323
2424func NewPushGoCmd (c * client.ClientWithResponses ) * cobra.Command {
2525 var dir = "."
26- var output = "tmp/go-package"
26+ var output = "/ tmp/go-package"
2727 var pkgURL string
2828 cmd := & cobra.Command {
2929 Use : "go <registry_name> <version>" ,
3030 Short : "Push Go Artifacts" ,
3131 Long : "Push Go Artifacts to Harness Artifact Registry" ,
3232 Args : cobra .ExactArgs (2 ),
3333 PreRun : func (cmd * cobra.Command , args []string ) {
34- config .Global .Registry .PkgURL = pkgURL
34+ if pkgURL != "" {
35+ config .Global .Registry .PkgURL = pkgURL
36+ } else {
37+ config .Global .Registry .PkgURL = config .Global .APIBaseURL
38+ }
3539 },
3640 RunE : func (cmd * cobra.Command , args []string ) error {
3741 registryName := args [0 ]
@@ -140,7 +144,5 @@ func NewPushGoCmd(c *client.ClientWithResponses) *cobra.Command {
140144 }
141145
142146 cmd .Flags ().StringVar (& pkgURL , "pkg-url" , "" , "Base URL for the Packages" )
143-
144- cmd .MarkFlagRequired ("pkg-url" )
145147 return cmd
146148}
You can’t perform that action at this time.
0 commit comments