MCPcopy
hub / github.com/MadAppGang/dingo / printMascot

Method printMascot

pkg/ui/simple_build_ui.go:130–167  ·  view source on GitHub ↗

printMascot prints the mascot with status

()

Source from the content-addressed store, hash-verified

128
129// printMascot prints the mascot with status
130func (ui *SimpleBuildUI) printMascot() {
131 ui.mu.Lock()
132 defer ui.mu.Unlock()
133
134 fmt.Println()
135
136 // Separator
137 separatorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("#45475A"))
138 fmt.Println(separatorStyle.Render(strings.Repeat("─", 60)))
139
140 // Get mascot frame
141 frame := ui.mascot.Render()
142
143 // Status lines
144 statusLines := ui.getStatusLines()
145
146 // Print side by side
147 maxLines := len(frame)
148 if len(statusLines) > maxLines {
149 maxLines = len(statusLines)
150 }
151
152 for i := 0; i < maxLines; i++ {
153 mascotLine := ""
154 if i < len(frame) {
155 mascotLine = ui.colorScheme.ApplyBodyColor(frame[i])
156 } else {
157 mascotLine = strings.Repeat(" ", 22) // Mascot width
158 }
159
160 statusLine := ""
161 if i < len(statusLines) {
162 statusLine = " " + statusLines[i]
163 }
164
165 fmt.Printf("%s%s\n", mascotLine, statusLine)
166 }
167}
168
169func (ui *SimpleBuildUI) getStatusLines() []string {
170 var lines []string

Callers 1

StopMethod · 0.95

Calls 4

getStatusLinesMethod · 0.95
RenderMethod · 0.80
ApplyBodyColorMethod · 0.80
PrintfMethod · 0.80

Tested by

no test coverage detected