From 317cdfe708eef68bf6607f94e1610147072131fc Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Mon, 28 Jul 2025 14:40:09 +0200 Subject: [PATCH 1/3] fix --- internal/output/plaintext_fns.go | 2 ++ internal/output/resource_output.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/output/plaintext_fns.go b/internal/output/plaintext_fns.go index f5bdb712..566ffcc0 100644 --- a/internal/output/plaintext_fns.go +++ b/internal/output/plaintext_fns.go @@ -65,6 +65,8 @@ var SingularPlaintextOutputFn = func(r resource) string { return email.(string) case id != nil: return id.(string) + case name != nil: + return name.(string) default: return "cannot read resource" } diff --git a/internal/output/resource_output.go b/internal/output/resource_output.go index a6dc68f1..6de5a7d1 100644 --- a/internal/output/resource_output.go +++ b/internal/output/resource_output.go @@ -103,7 +103,7 @@ func CmdOutput(action string, outputKind string, input []byte) (string, error) { } func plaintextOutput(out string, successMessage string) string { - if successMessage != "" { + if strings.TrimSpace(successMessage) != "" { return fmt.Sprintf("%s%s", successMessage, out) } From 1159667330afb043270909f9d5a1f8bf978559fd Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Mon, 28 Jul 2025 14:46:48 +0200 Subject: [PATCH 2/3] add note to readme on running locally --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 516af1ea..f83e81f8 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,12 @@ Additional documentation is available at https://docs.launchdarkly.com/home/gett We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this project. +### Running a local build of the CLI +If you wish to test your changes locally, simply +1. Clone this repo to your local machine; +2. Run `make build` from the repo root; +3. Run commands as usual with `./ldcli`. + ## Verifying build provenance with the SLSA framework LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published packages. To learn more, see the [provenance guide](./PROVENANCE.md). From b2a7bc62875c973a781964968678777a95047bcf Mon Sep 17 00:00:00 2001 From: Isabelle Miller Date: Mon, 28 Jul 2025 15:05:39 +0200 Subject: [PATCH 3/3] set 1 exit command when error --- cmd/root.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/root.go b/cmd/root.go index 1885c95c..c6989b36 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -270,6 +270,7 @@ See each command's help for details on how to use the generated script.`, rootCm case err != nil: outcome = analytics.ERROR fmt.Fprintln(os.Stderr, err.Error()) + os.Exit(1) default: outcome = analytics.SUCCESS }