From b446303b19750cd901f52448682d601de3340f2b Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 22 Dec 2023 13:00:37 -0600 Subject: [PATCH 1/2] fix npe running with no args --- cmd/bindown/cli.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/bindown/cli.go b/cmd/bindown/cli.go index 0134ee2..321f830 100644 --- a/cmd/bindown/cli.go +++ b/cmd/bindown/cli.go @@ -68,6 +68,9 @@ type rootCmd struct { } func (r *rootCmd) BeforeApply(k *kong.Context) error { + if k == nil || k.Selected() == nil { + return nil + } // set dependency positional to optional for install, wrap, download and extract. // We do this because we want to allow --all to be equivalent to specifying all // dependencies but want the help output to indicate that a dependency is required. From 39defea911484ac049ce21b0984c0f7c7c20d120 Mon Sep 17 00:00:00 2001 From: Will Roden Date: Fri, 22 Dec 2023 13:01:35 -0600 Subject: [PATCH 2/2] fix tests running on darwin/arm64 --- cmd/bindown/dependency_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/bindown/dependency_test.go b/cmd/bindown/dependency_test.go index 282f468..3d2b9c4 100644 --- a/cmd/bindown/dependency_test.go +++ b/cmd/bindown/dependency_test.go @@ -403,6 +403,7 @@ dependencies: runner := newCmdRunner(t) srcFile := filepath.Join(runner.tmpDir, "template-source.yaml") runner.writeConfigYaml(fmt.Sprintf(` +systems: ["linux/amd64", "darwin/amd64"] url_checksums: foo-linux-amd64-1.2.3: deadbeef foo-darwin-amd64-1.2.3: deadbeef @@ -436,6 +437,7 @@ dependencies: runner := newCmdRunner(t) srcFile := filepath.Join(runner.tmpDir, "template-source.yaml") runner.writeConfigYaml(fmt.Sprintf(` +systems: ["linux/amd64", "darwin/amd64"] url_checksums: foo-linux-amd64-1.2.3: deadbeef foo-darwin-amd64-1.2.3: deadbeef