Skip to content

Commit

Permalink
v0.0.31: browserless and sessionless fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed May 3, 2024
1 parent bce0148 commit 6573afe
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 32 deletions.
14 changes: 6 additions & 8 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,14 @@ func NewClient(cfg *cli.Config) (*Session, error) {
if apiToken, err = kr.Get(keyring.APIToken); err == keyring.ErrNotFound {
return anc, ErrSignedOut
}
if err != nil {
if gnomeKeyringMissing() {
return anc, ErrGnomeKeyringRequired
}

return nil, fmt.Errorf("reading PAT token from keyring failed: %w", err)
if err != nil && gnomeKeyringMissing() {
return anc, ErrGnomeKeyringRequired
}

if !strings.HasPrefix(apiToken, "ap0_") || len(apiToken) != 64 {
return nil, fmt.Errorf("read invalid PAT token from keyring")
if apiToken != "" {
if !strings.HasPrefix(apiToken, "ap0_") || len(apiToken) != 64 {
return nil, fmt.Errorf("read invalid PAT token from keyring")
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions auth/signin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/anchordotdev/cli/api"
"github.com/anchordotdev/cli/auth/models"
"github.com/anchordotdev/cli/keyring"
cliModels "github.com/anchordotdev/cli/models"
climodels "github.com/anchordotdev/cli/models"
"github.com/anchordotdev/cli/ui"
)

Expand Down Expand Up @@ -76,7 +76,7 @@ func (s *SignIn) RunTUI(ctx context.Context, drv *ui.Driver) error {
}

if err := browser.OpenURL(codes.VerificationUri); err != nil {
drv.Activate(ctx, &cliModels.Browserless{Url: codes.VerificationUri})
drv.Activate(ctx, &climodels.Browserless{Url: codes.VerificationUri})
}

drv.Activate(ctx, new(models.SignInChecker))
Expand Down
30 changes: 19 additions & 11 deletions lcl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ func (c LclConfig) perform(ctx context.Context, drv *ui.Driver) error {
return err
}

browserless := false

// If no certificates are missing, skip http and go directly to https
if len(auditInfo.Missing) != 0 {
httpURL, err := url.Parse("http://" + domain + ":" + diagPort)
Expand Down Expand Up @@ -189,14 +191,17 @@ func (c LclConfig) perform(ctx context.Context, drv *ui.Driver) error {

if !cfg.Trust.MockMode {
if err := browser.OpenURL(httpURL.String()); err != nil {
return err
browserless = true
drv.Activate(ctx, &models.Browserless{})
}
}

select {
case requestedScheme = <-requestc:
case <-ctx.Done():
return ctx.Err()
if !browserless {
select {
case requestedScheme = <-requestc:
case <-ctx.Done():
return ctx.Err()
}
}

if requestedScheme == "https" {
Expand Down Expand Up @@ -241,15 +246,18 @@ func (c LclConfig) perform(ctx context.Context, drv *ui.Driver) error {

if !cfg.Trust.MockMode {
if err := browser.OpenURL(httpsURL.String()); err != nil {
return err
browserless = true
drv.Activate(ctx, &models.Browserless{})
}
}

for requestedScheme != "https" {
select {
case requestedScheme = <-requestc:
case <-ctx.Done():
return ctx.Err()
if !browserless {
for requestedScheme != "https" {
select {
case requestedScheme = <-requestc:
case <-ctx.Done():
return ctx.Err()
}
}
}

Expand Down
12 changes: 12 additions & 0 deletions lcl/models/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,15 @@ func (m LclConfigSuccess) View() string {

return b.String()
}

type Browserless struct{}

func (m *Browserless) Init() tea.Cmd { return nil }

func (m *Browserless) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, nil }

func (m *Browserless) View() string {
var b strings.Builder
fmt.Fprintln(&b, ui.Warning("Unable to open browser, skipping browser-based verification."))
return b.String()
}
3 changes: 2 additions & 1 deletion lcl/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/anchordotdev/cli/cert"
"github.com/anchordotdev/cli/detection"
"github.com/anchordotdev/cli/lcl/models"
climodels "github.com/anchordotdev/cli/models"
"github.com/anchordotdev/cli/ui"
)

Expand Down Expand Up @@ -200,7 +201,7 @@ func (c Setup) perform(ctx context.Context, drv *ui.Driver) error {

if !cfg.Trust.MockMode {
if err := browser.OpenURL(setupGuideURL); err != nil {
return err
drv.Activate(ctx, &climodels.Browserless{Url: setupGuideURL})
}
}

Expand Down
6 changes: 5 additions & 1 deletion models/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ func (m *Browserless) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, nil }
func (m *Browserless) View() string {
var b strings.Builder

fmt.Fprintln(&b, ui.StepAlert(fmt.Sprintf("Unable to open browser. Please open this URL in a browser to continue: %s", m.Url)))
fmt.Fprintln(&b, ui.Warning("Unable to open browser."))
fmt.Fprintln(&b, ui.StepAlert(fmt.Sprintf("%s this in a browser to continue: %s.",
ui.Action("Open"),
ui.URL(m.Url),
)))

return b.String()
}
3 changes: 2 additions & 1 deletion testdata/TestError/golden-darwin_arm64.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
# Error! test error ``
| We are sorry you encountered this error.
! Press Enter to open an issue on Github.
! Unable to open browser. Please open this URL in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28darwin%2Farm64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+error
! Warning: Unable to open browser.
! Open this in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28darwin%2Farm64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+error.
3 changes: 2 additions & 1 deletion testdata/TestError/golden-linux_amd64.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
# Error! test error ``
| We are sorry you encountered this error.
! Press Enter to open an issue on Github.
! Unable to open browser. Please open this URL in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28linux%2Famd64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+error
! Warning: Unable to open browser.
! Open this in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28linux%2Famd64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+error.
3 changes: 2 additions & 1 deletion testdata/TestError/golden-windows_amd64.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
# Error! test error ``
| We are sorry you encountered this error.
! Press Enter to open an issue on Github.
! Unable to open browser. Please open this URL in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28windows%2Famd64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+error
! Warning: Unable to open browser.
! Open this in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28windows%2Famd64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+error.
3 changes: 2 additions & 1 deletion testdata/TestPanic/golden-darwin_arm64.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
# Error! test panic ``
| We are sorry you encountered this error.
! Press Enter to open an issue on Github.
! Unable to open browser. Please open this URL in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28darwin%2Farm64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStack%3A%2A%2A%0A%60%60%60%0Apanic%28%7B%3Chex%3E%2C+%3Chex%3E%7D%29%0A%09%3Cgoroot%3E%2Fsrc%2Fruntime%2Fpanic.go%3A%3Cline%3E+%2B%3Chex%3E%0Agithub.com%2Fanchordotdev%2Fcli_test.%28%2APanicCommand%29.run%28...%29%0A%09%3Cpwd%3E%2Fcli_test.go%3A74%0Agithub.com%2Fanchordotdev%2Fcli_test.TestPanic.func1%28%3Chex%3E%29%0A%09%3Cpwd%3E%2Fcli_test.go%3A101+%2B%3Chex%3E%0Atesting.tRunner%28%3Chex%3E%2C+%3Chex%3E%29%0A%09%3Cgoroot%3E%2Fsrc%2Ftesting%2Ftesting.go%3A%3Cline%3E+%2B%3Chex%3E%0Acreated+by+testing.%28%2AT%29.Run+in+gouroutine+%3Cint%3E%0A%09%3Cgoroot%3E%2Fsrc%2Ftesting%2Ftesting.go%3A%3Cline%3E+%2B%3Chex%3E%0A%60%60%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+panic
! Warning: Unable to open browser.
! Open this in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28darwin%2Farm64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStack%3A%2A%2A%0A%60%60%60%0Apanic%28%7B%3Chex%3E%2C+%3Chex%3E%7D%29%0A%09%3Cgoroot%3E%2Fsrc%2Fruntime%2Fpanic.go%3A%3Cline%3E+%2B%3Chex%3E%0Agithub.com%2Fanchordotdev%2Fcli_test.%28%2APanicCommand%29.run%28...%29%0A%09%3Cpwd%3E%2Fcli_test.go%3A74%0Agithub.com%2Fanchordotdev%2Fcli_test.TestPanic.func1%28%3Chex%3E%29%0A%09%3Cpwd%3E%2Fcli_test.go%3A101+%2B%3Chex%3E%0Atesting.tRunner%28%3Chex%3E%2C+%3Chex%3E%29%0A%09%3Cgoroot%3E%2Fsrc%2Ftesting%2Ftesting.go%3A%3Cline%3E+%2B%3Chex%3E%0Acreated+by+testing.%28%2AT%29.Run+in+gouroutine+%3Cint%3E%0A%09%3Cgoroot%3E%2Fsrc%2Ftesting%2Ftesting.go%3A%3Cline%3E+%2B%3Chex%3E%0A%60%60%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+panic.
3 changes: 2 additions & 1 deletion testdata/TestPanic/golden-linux_amd64.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
# Error! test panic ``
| We are sorry you encountered this error.
! Press Enter to open an issue on Github.
! Unable to open browser. Please open this URL in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28linux%2Famd64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStack%3A%2A%2A%0A%60%60%60%0Apanic%28%7B%3Chex%3E%2C+%3Chex%3E%7D%29%0A%09%3Cgoroot%3E%2Fsrc%2Fruntime%2Fpanic.go%3A%3Cline%3E+%2B%3Chex%3E%0Agithub.com%2Fanchordotdev%2Fcli_test.%28%2APanicCommand%29.run%28...%29%0A%09%3Cpwd%3E%2Fcli_test.go%3A74%0Agithub.com%2Fanchordotdev%2Fcli_test.TestPanic.func1%28%3Chex%3E%29%0A%09%3Cpwd%3E%2Fcli_test.go%3A101+%2B%3Chex%3E%0Atesting.tRunner%28%3Chex%3E%2C+%3Chex%3E%29%0A%09%3Cgoroot%3E%2Fsrc%2Ftesting%2Ftesting.go%3A%3Cline%3E+%2B%3Chex%3E%0Acreated+by+testing.%28%2AT%29.Run+in+gouroutine+%3Cint%3E%0A%09%3Cgoroot%3E%2Fsrc%2Ftesting%2Ftesting.go%3A%3Cline%3E+%2B%3Chex%3E%0A%60%60%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+panic
! Warning: Unable to open browser.
! Open this in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28linux%2Famd64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStack%3A%2A%2A%0A%60%60%60%0Apanic%28%7B%3Chex%3E%2C+%3Chex%3E%7D%29%0A%09%3Cgoroot%3E%2Fsrc%2Fruntime%2Fpanic.go%3A%3Cline%3E+%2B%3Chex%3E%0Agithub.com%2Fanchordotdev%2Fcli_test.%28%2APanicCommand%29.run%28...%29%0A%09%3Cpwd%3E%2Fcli_test.go%3A74%0Agithub.com%2Fanchordotdev%2Fcli_test.TestPanic.func1%28%3Chex%3E%29%0A%09%3Cpwd%3E%2Fcli_test.go%3A101+%2B%3Chex%3E%0Atesting.tRunner%28%3Chex%3E%2C+%3Chex%3E%29%0A%09%3Cgoroot%3E%2Fsrc%2Ftesting%2Ftesting.go%3A%3Cline%3E+%2B%3Chex%3E%0Acreated+by+testing.%28%2AT%29.Run+in+gouroutine+%3Cint%3E%0A%09%3Cgoroot%3E%2Fsrc%2Ftesting%2Ftesting.go%3A%3Cline%3E+%2B%3Chex%3E%0A%60%60%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+panic.
3 changes: 2 additions & 1 deletion testdata/TestPanic/golden-windows_amd64.golden
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
# Error! test panic ``
| We are sorry you encountered this error.
! Press Enter to open an issue on Github.
! Unable to open browser. Please open this URL in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28windows%2Famd64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStack%3A%2A%2A%0A%60%60%60%0Apanic%28%7B%3Chex%3E%2C+%3Chex%3E%7D%29%0A%09C%3A%2Fhostedtoolcache%2Fwindows%2Fgo%2F1.21.9%2Fx64%2Fsrc%2Fruntime%2Fpanic.go%3A920+%2B%3Chex%3E%0Agithub.com%2Fanchordotdev%2Fcli_test.%28%2APanicCommand%29.run%28...%29%0A%09D%3A%2Fa%2Fanchor%2Fanchor%2Fcli%2Fcli_test.go%3A74%0Agithub.com%2Fanchordotdev%2Fcli_test.TestPanic.func1%28%3Chex%3E%29%0A%09D%3A%2Fa%2Fanchor%2Fanchor%2Fcli%2Fcli_test.go%3A101+%2B%3Chex%3E%0Atesting.tRunner%28%3Chex%3E%2C+%3Chex%3E%29%0A%09C%3A%2Fhostedtoolcache%2Fwindows%2Fgo%2F1.21.9%2Fx64%2Fsrc%2Ftesting%2Ftesting.go%3A1595+%2B%3Chex%3E%0Acreated+by+testing.%28%2AT%29.Run+in+gouroutine+%3Cint%3E%0A%09C%3A%2Fhostedtoolcache%2Fwindows%2Fgo%2F1.21.9%2Fx64%2Fsrc%2Ftesting%2Ftesting.go%3A1648+%2B%3Chex%3E%0A%60%60%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+panic
! Warning: Unable to open browser.
! Open this in a browser to continue: https://github.com/anchordotdev/cli/issues/new?body=%2A%2AAre+there+any+additional+details+you+would+like+to+share%3F%2A%2A%0A%0A---%0A%0A%2A%2ACommand%3A%2A%2A+%60%60%0A%2A%2AVersion%3A%2A%2A+%60dev+%28windows%2Famd64%29+Commit%3A+none+BuildDate%3A+unknown%60%0A%2A%2AArguments%3A%2A%2A+%60%5B%5D%60%0A%2A%2AFlags%3A%2A%2A+%60%5B%5D%60%0A%2A%2AStack%3A%2A%2A%0A%60%60%60%0Apanic%28%7B%3Chex%3E%2C+%3Chex%3E%7D%29%0A%09C%3A%2Fhostedtoolcache%2Fwindows%2Fgo%2F1.21.9%2Fx64%2Fsrc%2Fruntime%2Fpanic.go%3A920+%2B%3Chex%3E%0Agithub.com%2Fanchordotdev%2Fcli_test.%28%2APanicCommand%29.run%28...%29%0A%09D%3A%2Fa%2Fanchor%2Fanchor%2Fcli%2Fcli_test.go%3A74%0Agithub.com%2Fanchordotdev%2Fcli_test.TestPanic.func1%28%3Chex%3E%29%0A%09D%3A%2Fa%2Fanchor%2Fanchor%2Fcli%2Fcli_test.go%3A101+%2B%3Chex%3E%0Atesting.tRunner%28%3Chex%3E%2C+%3Chex%3E%29%0A%09C%3A%2Fhostedtoolcache%2Fwindows%2Fgo%2F1.21.9%2Fx64%2Fsrc%2Ftesting%2Ftesting.go%3A1595+%2B%3Chex%3E%0Acreated+by+testing.%28%2AT%29.Run+in+gouroutine+%3Cint%3E%0A%09C%3A%2Fhostedtoolcache%2Fwindows%2Fgo%2F1.21.9%2Fx64%2Fsrc%2Ftesting%2Ftesting.go%3A1648+%2B%3Chex%3E%0A%60%60%60%0A%2A%2AStdout%3A%2A%2A%0A%60%60%60%0A%0A%60%60%60%0A&title=Error%3A+test+panic.
7 changes: 4 additions & 3 deletions ui/styles.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ var (
StepInProgress = lipgloss.NewStyle().SetString(" *").Render
StepPrompt = lipgloss.NewStyle().SetString(" " + Prompt.Render("?")).Render

Announce = lipgloss.NewStyle().Background(colorBrandSecondary).Render
bgBanana = lipgloss.NewStyle().Background(colorBanana).Render

Accentuate = lipgloss.NewStyle().Italic(true).Render
Action = lipgloss.NewStyle().Bold(true).Foreground(colorBrandPrimary).Render
Announce = lipgloss.NewStyle().Background(colorBrandSecondary).Render
Error = lipgloss.NewStyle().Bold(true).Foreground(colorDanger).Render
Emphasize = lipgloss.NewStyle().Bold(true).Render
EmphasizeUnderline = lipgloss.NewStyle().Bold(true).Underline(true).Render
Titlize = lipgloss.NewStyle().Bold(true).Render
URL = lipgloss.NewStyle().Faint(true).Underline(true).Render
Whisper = lipgloss.NewStyle().Faint(true).Render

bgBanana = lipgloss.NewStyle().Background(colorBanana).Render

fgBanana = lipgloss.NewStyle().Foreground(colorBanana).Render
fgMidnight = lipgloss.NewStyle().Foreground(colorMidnight).Render

Expand All @@ -54,6 +54,7 @@ var (
colorMandarin = lipgloss.Color("#FF6000")
colorApple = lipgloss.Color("#CE4433")
colorBanana = lipgloss.Color("#FBF5AC")
// colorLime = lipgloss.Color("#9EC756")

Prompt = lipgloss.NewStyle().Foreground(colorBrandPrimary)

Expand Down

0 comments on commit 6573afe

Please sign in to comment.