feat: Auto-detect term for coloring helm-diff output

Since helm-diff has added an ability to auto-detect the term to decide if it should output with color or not, helmfile had been defaulted to no-color.
This resoloves that, by adding a term-detection logic that is same as helm-diff.

As a part of this work, I have also implemented a new global flag `--color`, which is used for forcing color without relying on the term-detection logic implemented in helmfile or explicitly setting the HELM_DIFF_COLOR envvar. I hope it is useful for folks.

Ref https://github.com/roboll/helmfile/issues/2043

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
Yusuke Kuoka
2022-04-06 02:38:36 +00:00
parent 8fb418e3c9
commit 97e0ca73ca
6 changed files with 42 additions and 2 deletions
+4
View File
@@ -93,6 +93,10 @@ func (a diffConfig) SuppressDiff() bool {
return a.suppressDiff
}
func (a diffConfig) Color() bool {
return false
}
func (a diffConfig) NoColor() bool {
return a.noColor
}