Skip to content

Commit 4f2b077

Browse files
feat: [AH-1598]: fix cli issues
1 parent acb43de commit 4f2b077

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cmd/ar/command/push_go.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,19 @@ import (
2323

2424
func 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
}

0 commit comments

Comments
 (0)