From 576e0efbc65b036f2a80dcc7c55fd68cbb8c4ea1 Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Mon, 12 Aug 2024 09:16:16 +1000 Subject: [PATCH] fix: additional new lines on rendering info output (#373) --- cmd/root.go | 6 +++--- cmd/users.go | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 2d1ed184..7d2076a3 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -67,17 +67,17 @@ var rootCmd = &cobra.Command{ // Do periodic detection of whether an update is available for lagoon-cli users. timeToCheckForUpdates, err := updatecheck.IsUpdateNeeded(updateFile, updateInterval) if err != nil { - output.RenderInfo(fmt.Sprintf("Could not perform update check %v", err), outputOptions) + output.RenderInfo(fmt.Sprintf("Could not perform update check %v\n", err), outputOptions) } if timeToCheckForUpdates && isInternetActive() { // Recreate the updatefile with current time so we won't do this again soon. err = updatecheck.ResetUpdateTime(updateFile) if err != nil { - output.RenderInfo(fmt.Sprintf("Failed to update updatecheck file %s", updateFile), outputOptions) + output.RenderInfo(fmt.Sprintf("Failed to update updatecheck file %s\n", updateFile), outputOptions) } updateNeeded, updateURL, err := updatecheck.AvailableUpdates("uselagoon", "lagoon-cli", lagoonCLIVersion) if err != nil { - output.RenderInfo("Could not check for updates. This is most often caused by a networking issue.", outputOptions) + output.RenderInfo("Could not check for updates. This is most often caused by a networking issue.\n", outputOptions) output.RenderError(err.Error(), outputOptions) return } diff --git a/cmd/users.go b/cmd/users.go index a88c7672..d8804d3f 100644 --- a/cmd/users.go +++ b/cmd/users.go @@ -49,7 +49,7 @@ func parseSSHKeyFile(sshPubKey string, keyName string, keyValue string, userEmai keyName = stripNewLines(splitKey[2]) } else if keyName == "" && len(splitKey) == 2 { keyName = userEmail - output.RenderInfo("no name provided, using email address as key name", outputOptions) + output.RenderInfo("no name provided, using email address as key name\n", outputOptions) } SSHKeyInput := schema.AddSSHKeyInput{ SSHKey: schema.SSHKey{ @@ -407,7 +407,8 @@ var getUserKeysCmd = &cobra.Command{ return err } if len(userKeys.SSHKeys) == 0 { - return handleNilResults("No SSH keys for user '%s'\n", cmd, strings.ToLower(userEmail)) + return handleNilResults("There are no SSH keys for user '%s'\n", cmd, strings.ToLower(userEmail)) + return nil } data := []output.Data{}