Skip to content

Commit

Permalink
fix: Removes a whitespace between Path key and value when creating a …
Browse files Browse the repository at this point in the history
…zip/nupkg with json output format
  • Loading branch information
mik-ky committed Sep 18, 2024
1 parent f61fd81 commit 59de77a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
15 changes: 8 additions & 7 deletions pkg/cmd/package/nuget/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,15 @@ 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())
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())
cmd.Println()
default: // table
cmd.Printf("Successfully created package %s\n", nuget.Name())
}
}
return err
Expand Down
15 changes: 8 additions & 7 deletions pkg/cmd/package/zip/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ 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())
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())
cmd.Println()
default: // table
cmd.Printf("Successfully created package %s\n", zip.Name())
}
}
return err
Expand Down

0 comments on commit 59de77a

Please sign in to comment.