bisync: fix --colors flag

quick fix to get around lack of support in fs.Infof etc.
This commit is contained in:
nielash
2023-12-23 15:31:33 -05:00
parent 0f549520ef
commit 8d3bcc025a
3 changed files with 11 additions and 2 deletions

View File

@ -62,8 +62,13 @@ func quotePath(path string) string {
return escapePath(path, true)
}
var Colors bool // Colors controls whether terminal colors are enabled
// Color handles terminal colors for bisync
func Color(style string, s string) string {
if !Colors {
return s
}
terminal.Start()
return style + s + terminal.Reset
}