Skip to content

Commit

Permalink
fix: don't force truecolor rendering in non-truecolor terminals
Browse files Browse the repository at this point in the history
oops! what a silly bug. A stray call to SetColorProfile.

fixes #130
  • Loading branch information
amonks committed Apr 19, 2024
1 parent 7c23c02 commit 893e055
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 29 deletions.
5 changes: 0 additions & 5 deletions internal/help/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/amonks/run/internal/color"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
)

type Menu []Section
Expand All @@ -28,10 +27,6 @@ type Key struct {
Desc string
}

func init() {
lipgloss.SetColorProfile(termenv.TrueColor)
}

var (
Monochrome = &Styles{
Container: lipgloss.NewStyle(),
Expand Down
Binary file modified screenshots/nontty.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/printer.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/tui.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions tasks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@
cmd = """
mkdir -p testdata/cli_snapshots
go run ./cmd/run -version &> testdata/cli_snapshots/version
go run ./cmd/run -help &> testdata/cli_snapshots/help
go run ./cmd/run -credits &> testdata/cli_snapshots/credits
go run ./cmd/run -contributors &> testdata/cli_snapshots/contributors
go run ./cmd/run -license &> testdata/cli_snapshots/license
go run ./cmd/run -list &> testdata/cli_snapshots/list
CLICOLOR_FORCE=true go run ./cmd/run -version &> testdata/cli_snapshots/version
CLICOLOR_FORCE=true go run ./cmd/run -help &> testdata/cli_snapshots/help
CLICOLOR_FORCE=true go run ./cmd/run -credits &> testdata/cli_snapshots/credits
CLICOLOR_FORCE=true go run ./cmd/run -contributors &> testdata/cli_snapshots/contributors
CLICOLOR_FORCE=true go run ./cmd/run -license &> testdata/cli_snapshots/license
CLICOLOR_FORCE=true go run ./cmd/run -list &> testdata/cli_snapshots/list
if ! git diff --exit-code -- testdata/cli_snapshots ; then
exit 1
Expand Down
36 changes: 18 additions & 18 deletions testdata/cli_snapshots/list
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

TASKS

prerelease
prerelease
Type: short
Description:
 - run the tests
Expand All @@ -12,19 +12,19 @@
- generate-docs
- validate

install
install
Type: short
Description:
 "go install ./cmd/run"
Dependencies:
- generate

generate
generate
Type: short
Description:
 "go generate ./..."

validate
validate
Type: short
Dependencies:
- generate
Expand All @@ -34,67 +34,67 @@
- snapshot-cli
- shellcheck

test
test
Type: short
Description:
 "go test ./..."

vulncheck
vulncheck
Type: short
Description:
 "go run golang.org/x/vuln/cmd/govulncheck ./..."

staticcheck
staticcheck
Type: short
Description:
 "go run honnef.co/go/tools/cmd/staticcheck ./..."

shellcheck
shellcheck
Type: short
Description:
 "shellcheck $(git ls-files | grep 'sh$')"

screenshots
screenshots
Type: short
Dependencies:
- screenshot-tui
- screenshot-printer
- screenshot-nontty

screenshot-tui
screenshot-tui
Type: short
Dependencies:
- install
- screenshots-deps

screenshot-printer
screenshot-printer
Type: short
Dependencies:
- install
- screenshots-deps

screenshot-nontty
screenshot-nontty
Type: short
Dependencies:
- install
- screenshots-deps

screenshots-deps
screenshots-deps
Type: short

reset-snapshot-failures
reset-snapshot-failures
Type: short

overwrite-snapshots
overwrite-snapshots
Type: short

generate-docs
generate-docs
Type: short

generate-readme-usage
generate-readme-usage
Type: short

snapshot-cli
snapshot-cli
Type: short
Dependencies:
- generate
Expand Down

0 comments on commit 893e055

Please sign in to comment.