Skip to content

Commit 2c02f00

Browse files
authored
CLOUDP-185078: Address AtlasCLI release failure due to Chocolatey push source configuration (#2014)
1 parent 8cead8d commit 2c02f00

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/chocolateyupdate/main.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import (
2121
"os/exec"
2222
)
2323

24-
func update(path, secret string) error {
25-
cmd := exec.Command("choco", "push", path, "--api-key", secret)
24+
func update(path, secret string, sourcePath string) error {
25+
cmd := exec.Command("choco", "push", path, "--api-key", secret, "--source", sourcePath)
2626
cmd.Stdout = os.Stdout
2727
cmd.Stderr = os.Stderr
2828
err := cmd.Run()
@@ -31,16 +31,18 @@ func update(path, secret string) error {
3131

3232
func main() {
3333
var packagePath string
34+
var sourcePath string
3435
secret := os.Getenv("SECRET_API_KEY")
3536

3637
flag.StringVar(&packagePath, "path", "", "Chocolatey package path")
38+
flag.StringVar(&sourcePath, "source", "https://push.chocolatey.org/", "Chocolatey source path")
3739
flag.Parse()
3840

3941
if packagePath == "" {
4042
log.Fatalln("You must specify Chocolatey package path")
4143
}
4244

43-
err := update(packagePath, secret)
45+
err := update(packagePath, secret, sourcePath)
4446
if err != nil {
4547
log.Fatal(err)
4648
}

0 commit comments

Comments
 (0)