feat: colorized DELETED (#1944)
feat: colorize DELETED Signed-off-by: Eric Bailey <eric@ericb.me>
This commit is contained in:
		
							parent
							
								
									82a2f7ed2f
								
							
						
					
					
						commit
						156a7576b5
					
				
							
								
								
									
										2
									
								
								go.mod
								
								
								
								
							
							
						
						
									
										2
									
								
								go.mod
								
								
								
								
							|  | @ -52,7 +52,7 @@ require ( | ||||||
| 	github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect | 	github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect | ||||||
| 	github.com/blang/semver v3.5.1+incompatible // indirect | 	github.com/blang/semver v3.5.1+incompatible // indirect | ||||||
| 	github.com/dimchansky/utfbom v1.1.1 // indirect | 	github.com/dimchansky/utfbom v1.1.1 // indirect | ||||||
| 	github.com/fatih/color v1.18.0 // indirect | 	github.com/fatih/color v1.18.0 | ||||||
| 	github.com/fujiwara/tfstate-lookup v1.5.0 // indirect | 	github.com/fujiwara/tfstate-lookup v1.5.0 // indirect | ||||||
| 	github.com/golang-jwt/jwt/v4 v4.5.1 // indirect | 	github.com/golang-jwt/jwt/v4 v4.5.1 // indirect | ||||||
| 	github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | 	github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||||||
|  |  | ||||||
|  | @ -7,6 +7,8 @@ import ( | ||||||
| 	"sort" | 	"sort" | ||||||
| 	"strings" | 	"strings" | ||||||
| 
 | 
 | ||||||
|  | 	"github.com/fatih/color" | ||||||
|  | 
 | ||||||
| 	"github.com/helmfile/helmfile/pkg/helmexec" | 	"github.com/helmfile/helmfile/pkg/helmexec" | ||||||
| 	"github.com/helmfile/helmfile/pkg/state" | 	"github.com/helmfile/helmfile/pkg/state" | ||||||
| ) | ) | ||||||
|  | @ -216,7 +218,11 @@ func (r *Run) diff(triggerCleanupEvent bool, detailedExitCode bool, c DiffConfig | ||||||
| 		names = append(names, fmt.Sprintf("  %s (%s) UPDATED", r.Name, r.Chart)) | 		names = append(names, fmt.Sprintf("  %s (%s) UPDATED", r.Name, r.Chart)) | ||||||
| 	} | 	} | ||||||
| 	for _, r := range releasesToBeDeleted { | 	for _, r := range releasesToBeDeleted { | ||||||
| 		names = append(names, fmt.Sprintf("  %s (%s) DELETED", r.Name, r.Chart)) | 		releaseToBeDeleted := fmt.Sprintf("  %s (%s) DELETED", r.Name, r.Chart) | ||||||
|  | 		if c.Color() { | ||||||
|  | 			releaseToBeDeleted = color.RedString(releaseToBeDeleted) | ||||||
|  | 		} | ||||||
|  | 		names = append(names, releaseToBeDeleted) | ||||||
| 	} | 	} | ||||||
| 	// Make the output deterministic for testing purpose
 | 	// Make the output deterministic for testing purpose
 | ||||||
| 	sort.Strings(names) | 	sort.Strings(names) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue