From 61982e469eb3b3133ddb85f049d33729f011bba2 Mon Sep 17 00:00:00 2001 From: Gorbunov Kirill Andreevich Date: Tue, 2 Apr 2024 17:51:03 +0300 Subject: [PATCH] #8 add default. --- cmd/pkgdashcli/main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmd/pkgdashcli/main.go b/cmd/pkgdashcli/main.go index 5caaa29..c8a5788 100644 --- a/cmd/pkgdashcli/main.go +++ b/cmd/pkgdashcli/main.go @@ -238,7 +238,8 @@ func Execute(ctx context.Context, gitSource source.SourceControl, mvs map[string switch cliCfg.Command { case "checkupdate": - logger.Info(ctx, fmt.Sprintf("Modules get update: \n %s", mvs)) + js, err := json.Marshal(mvs) + fmt.Println(fmt.Sprintf(`Modules get update: %s, %s`, js, err)) case "update": if cliCfg.Path != "" { // update one dep path = cliCfg.Path @@ -303,9 +304,13 @@ func Execute(ctx context.Context, gitSource source.SourceControl, mvs map[string prList[branch] = rMap } - logger.Info(ctx, fmt.Sprintf("for %s:\n%s", cfg.Source.Repository, prList)) + js, err := json.Marshal(prList) + if err != nil { + logger.Error(ctx, fmt.Sprintf("error: %s", err)) + } + fmt.Println(fmt.Sprintf("for %s:\n%s", cfg.Source.Repository, js)) default: - logger.Info(ctx, initMsg) + fmt.Print(initMsg) } }