// RunAddTransformer runs add transformer command (do real work).
RunAddTransformer runs add transformer command (do real work).
// RunAddTransformer runs add transformer command ( do real work ) .
func (o *addTransformerOptions) RunAddTransformer(fSys filesys.FileSystem) error {
	transformers, err := util.GlobPatterns(fSys, o.transformerFilePaths)
	if err != nil {
		return err
	}
	if len(transformers) == 0 {
		return nil
	}
	mf, err := kustfile.NewKustomizationFile(fSys)
	if err != nil {
		return err
	}
	m, err := mf.Read()
	if err != nil {
		return err
	}
	for _, t := range transformers {
		if kustfile.StringInSlice(t, m.Transformers) {
			log.Printf("transformer %s already in kustomization file", t)
			continue
		}
		m.Transformers = append(m.Transformers, t)
	}
	return mf.Write(m)
}
func ( o * addTransformerOptions ) RunAddTransformer ( fSys filesys . FileSystem ) error { transformers , err := util . GlobPatterns ( fSys , o . transformerFilePaths ) if err != nil { return err } if len ( transformers ) == 0 { return nil } mf , err := kustfile . NewKustomizationFile ( fSys ) if err != nil { return err } m , err := mf . Read ( ) if err != nil { return err } for _ , t := range transformers { if kustfile . StringInSlice ( t , m . Transformers ) { log . Printf ( " " , t ) continue } m . Transformers = append ( m . Transformers , t ) } return mf . Write ( m ) }
RunAddTransformer runs add transformer command (do real work).
RunAddTransformer runs add transformer command ( do real work ) .