mirror of
https://github.com/go-task/task.git
synced 2025-11-25 22:32:55 +02:00
Add FORCE_COLOR env support (#1003)
This commit is contained in:
@@ -34,6 +34,10 @@ func Red() PrintFunc {
|
||||
}
|
||||
|
||||
func envColor(env string, defaultColor color.Attribute) color.Attribute {
|
||||
if os.Getenv("FORCE_COLOR") != "" {
|
||||
color.NoColor = false
|
||||
}
|
||||
|
||||
override, err := strconv.Atoi(os.Getenv(env))
|
||||
if err == nil {
|
||||
return color.Attribute(override)
|
||||
|
||||
Reference in New Issue
Block a user