mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
Update buildkit w/ customizable output colors, etc.
Signed-off-by: Sean P. Kane <spkane00@gmail.com>
This commit is contained in:
37
vendor/github.com/moby/buildkit/util/progress/progressui/init.go
generated
vendored
Normal file
37
vendor/github.com/moby/buildkit/util/progress/progressui/init.go
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
package progressui
|
||||
|
||||
import (
|
||||
"os"
|
||||
"runtime"
|
||||
|
||||
"github.com/morikuni/aec"
|
||||
)
|
||||
|
||||
var colorRun aec.ANSI
|
||||
var colorCancel aec.ANSI
|
||||
var colorWarning aec.ANSI
|
||||
var colorError aec.ANSI
|
||||
|
||||
func init() {
|
||||
// As recommended on https://no-color.org/
|
||||
if _, ok := os.LookupEnv("NO_COLOR"); ok {
|
||||
// nil values will result in no ANSI color codes being emitted.
|
||||
return
|
||||
} else if runtime.GOOS == "windows" {
|
||||
colorRun = termColorMap["cyan"]
|
||||
colorCancel = termColorMap["yellow"]
|
||||
colorWarning = termColorMap["yellow"]
|
||||
colorError = termColorMap["red"]
|
||||
} else {
|
||||
colorRun = termColorMap["blue"]
|
||||
colorCancel = termColorMap["yellow"]
|
||||
colorWarning = termColorMap["yellow"]
|
||||
colorError = termColorMap["red"]
|
||||
}
|
||||
|
||||
// Loosely based on the standard set by Linux LS_COLORS.
|
||||
if _, ok := os.LookupEnv("BUILDKIT_COLORS"); ok {
|
||||
envColorString := os.Getenv("BUILDKIT_COLORS")
|
||||
setUserDefinedTermColors(envColorString)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user