Skip to content

Commit

Permalink
Merge pull request #411 from OctopusDeploy/revert-409-chris/package/r…
Browse files Browse the repository at this point in the history
…emove-whitespace-jsonoutput

Revert "Removes a whitespace between Path key and value when creating a zip p…"
  • Loading branch information
tothegills authored Sep 18, 2024
2 parents 8a6d231 + ac3b321 commit 2d451e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
15 changes: 7 additions & 8 deletions pkg/cmd/package/nuget/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 7 additions & 8 deletions pkg/cmd/package/zip/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d451e4

Please sign in to comment.