MCPcopy
hub / github.com/basecamp/once / Run

Function Run

internal/ui/app.go:267–283  ·  view source on GitHub ↗
(ns *docker.Namespace, installImageRef string)

Source from the content-addressed store, hash-verified

265}
266
267func Run(ns *docker.Namespace, installImageRef string) error {
268 slog.Info("Starting ONCE UI", "version", version.Version)
269 defer func() { slog.Info("Stopping ONCE UI") }()
270
271 detected := DetectTerminalColors(100 * time.Millisecond)
272 ApplyPalette(NewPalette(detected))
273
274 app := NewApp(ns, installImageRef)
275
276 var opts []tea.ProgramOption
277 if detected.SupportsTrueColor() {
278 opts = append(opts, tea.WithColorProfile(colorprofile.TrueColor))
279 }
280
281 _, err := tea.NewProgram(app, opts...).Run()
282 return err
283}
284
285// Private
286

Callers 1

NewRootCommandFunction · 0.92

Calls 6

DetectTerminalColorsFunction · 0.85
ApplyPaletteFunction · 0.85
NewPaletteFunction · 0.85
NewAppFunction · 0.85
SupportsTrueColorMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected