Skip to content

Commit

Permalink
chore: minor adjustments to the status display (#2750)
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas authored Sep 20, 2024
1 parent 13b7cd7 commit 1e2a6e8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const BuildStateDeploying BuildState = " 🚚️"
const BuildStateDeployed BuildState = " ✅️️"
const BuildStateFailed BuildState = "💥"

// moduleStatusPadding is the padding between module status entries
// it accounts for the colon, space and the emoji
const moduleStatusPadding = 10

var _ StatusManager = &terminalStatusManager{}
var _ StatusLine = &terminalStatusLine{}

Expand Down Expand Up @@ -306,7 +310,7 @@ func (r *terminalStatusManager) recalculateLines() {
entryLength := 0
keys := []string{}
for k := range r.moduleStates {
thisLength := len(k) + 8
thisLength := len(k) + moduleStatusPadding
if thisLength > entryLength {
entryLength = thisLength
}
Expand All @@ -322,7 +326,7 @@ func (r *terminalStatusManager) recalculateLines() {
if i%perLine == 0 && i > 0 {
msg += "\n"
}
pad := strings.Repeat(" ", entryLength-len(k)-8)
pad := strings.Repeat(" ", entryLength-len(k)-moduleStatusPadding+2)
state := r.moduleStates[k]
msg += pad + buildColors[state] + k + ": " + string(state) + "\u001B[39m"
}
Expand Down

0 comments on commit 1e2a6e8

Please sign in to comment.