From ac3b32172c87b1ce08c6824dcc9e923d8d873ce8 Mon Sep 17 00:00:00 2001 From: Chris Kim <97423717+mik-ky@users.noreply.github.com> Date: Wed, 18 Sep 2024 17:01:15 +1200 Subject: [PATCH] =?UTF-8?q?Revert=20"Removes=20a=20whitespace=20between=20?= =?UTF-8?q?Path=20key=20and=20value=20when=20creating=20a=20zip=20p?= =?UTF-8?q?=E2=80=A6"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/cmd/package/nuget/create/create.go | 15 +++++++-------- pkg/cmd/package/zip/create/create.go | 15 +++++++-------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/pkg/cmd/package/nuget/create/create.go b/pkg/cmd/package/nuget/create/create.go index e7718d03..dd466cb3 100644 --- a/pkg/cmd/package/nuget/create/create.go +++ b/pkg/cmd/package/nuget/create/create.go @@ -151,15 +151,14 @@ func createRun(cmd *cobra.Command, opts *NuPkgCreateOptions) error { } nuget, err := pack.BuildPackage(opts.PackageCreateOptions, outFilePath) - if nuget != nil { + if (nuget != nil) { switch outputFormat { - case constants.OutputFormatBasic: - cmd.Printf("%s\n", nuget.Name()) - case constants.OutputFormatJson: - cmd.Printf(`{"Path":"%s"}`, nuget.Name()) - cmd.Println() - default: // table - cmd.Printf("Successfully created package %s\n", nuget.Name()) + case constants.OutputFormatBasic: + cmd.Printf("%s\n", nuget.Name()) + case constants.OutputFormatJson: + cmd.Printf(`{"Path": "%s"}`, nuget.Name()) + default: // table + cmd.Printf("Successfully created package %s\n", nuget.Name()) } } return err diff --git a/pkg/cmd/package/zip/create/create.go b/pkg/cmd/package/zip/create/create.go index 8b50471a..21c7be04 100644 --- a/pkg/cmd/package/zip/create/create.go +++ b/pkg/cmd/package/zip/create/create.go @@ -78,15 +78,14 @@ func createRun(cmd *cobra.Command, opts *pack.PackageCreateOptions) error { outFilePath := pack.BuildOutFileName("zip", opts.Id.Value, opts.Version.Value) zip, err := pack.BuildPackage(opts, outFilePath) - if zip != nil { + if (zip != nil) { switch outputFormat { - case constants.OutputFormatBasic: - cmd.Printf("%s\n", zip.Name()) - case constants.OutputFormatJson: - cmd.Printf(`{"Path":"%s"}`, zip.Name()) - cmd.Println() - default: // table - cmd.Printf("Successfully created package %s\n", zip.Name()) + case constants.OutputFormatBasic: + cmd.Printf("%s\n", zip.Name()) + case constants.OutputFormatJson: + cmd.Printf(`{"Path": "%s"}`, zip.Name()) + default: // table + cmd.Printf("Successfully created package %s\n", zip.Name()) } } return err