Skip to content

Commit

Permalink
[ui] Fix Non-interactive UI debug output (#508)
Browse files Browse the repository at this point in the history
* Fix noninteractive UI output functions

The previous implementation used simple string concatenation. When updating for colorized output, the parameters were not properly converted to printf-style format strings and args.

* Add changelog
  • Loading branch information
angrycub authored May 3, 2024
1 parent 05ab8fc commit bff08ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## UNRELEASED

IMPROVEMENTS:
* cli: Emit the modify index in the output of `nomad-pack plan` [[GH-507](https://github.com/hashicorp/nomad-pack/pull/507)]

BUG FIXES:
* cli: Fix non-interactive UI debug print output [[GH-508](https://github.com/hashicorp/nomad-pack/pull/508)]

## 0.1.1 (April 26,2024)

IMPROVEMENTS:
Expand Down Expand Up @@ -28,10 +34,6 @@ DEPENDENCY CHANGES:
* deps: Bump golang.org/x/crypto from 0.16.0 to 0.17.0 [[GH-477](https://github.com/hashicorp/nomad-pack/pull/477)]
* deps: Bump github.com/go-jose/go-jose/v3 from 3.0.0 to 3.0.1 [[GH-474](https://github.com/hashicorp/nomad-pack/pull/474)]

IMPROVEMENTS:

* cli: output the modify index after planning [[GH-507](https://github.com/hashicorp/nomad-pack/pull/507)]

## 0.1.0 (October 31, 2023)

* **Generate Variable Override Files for Packs** - With
Expand Down
6 changes: 3 additions & 3 deletions terminal/noninteractive.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (ui *nonInteractiveUI) Output(msg string, raw ...any) {

switch style {
case DebugStyle:
msg = colorDebug.Sprintf("debug: %s\n" + msg)
msg = colorDebug.Sprintf("debug: %s\n", msg)
case HeaderStyle:
msg = "\n» " + msg
case ErrorStyle, ErrorBoldStyle:
Expand All @@ -63,9 +63,9 @@ func (ui *nonInteractiveUI) Output(msg string, raw ...any) {

return
case WarningStyle, WarningBoldStyle:
msg = colorWarning.Sprintf("warning: %s\n" + msg)
msg = colorWarning.Sprintf("warning: %s\n", msg)
case TraceStyle:
msg = colorTrace.Sprintf("trace: %s\n" + msg)
msg = colorTrace.Sprintf("trace: %s\n", msg)
case SuccessStyle, SuccessBoldStyle:

case InfoStyle:
Expand Down

0 comments on commit bff08ce

Please sign in to comment.