@@ -145,26 +145,25 @@ func RenameBuildFiles(basePath, targetBuild string) error {
145145 return fmt .Errorf ("error renaming file \" %s\" : %w" , file , err )
146146 }
147147 }
148+ }
148149
149- // Rename *_BUILD_TYPE.tf.example to *_BUILD_TYPE.tf if they exist.
150- pattern := filepath .Join (basePath , fmt .Sprintf ("*_%s.tf%s" , targetBuild , DisableFileSuffix ))
151- files , err := filepath .Glob (pattern )
152- if err != nil {
153- return fmt .Errorf ("error finding files (target rename): %w" , err )
154- }
150+ // Rename *_BUILD_TYPE.tf.example to *_BUILD_TYPE.tf if they exist.
151+ pattern := filepath .Join (basePath , fmt .Sprintf ("*_%s.tf%s" , targetBuild , DisableFileSuffix ))
152+ files , err := filepath .Glob (pattern )
153+ if err != nil {
154+ return fmt .Errorf ("error finding files (target rename): %w" , err )
155+ }
155156
156- for _ , file := range files {
157- baseName := strings .TrimSuffix (file , fmt .Sprintf (".tf%s" , DisableFileSuffix ))
158- newName := baseName + ".tf"
157+ for _ , file := range files {
158+ baseName := strings .TrimSuffix (file , fmt .Sprintf (".tf%s" , DisableFileSuffix ))
159+ newName := baseName + ".tf"
159160
160- fmt .Printf ("Renaming \" %s\" to \" %s\" \n " , file , newName )
161+ fmt .Printf ("Renaming \" %s\" to \" %s\" \n " , file , newName )
161162
162- err := os .Rename (file , newName )
163- if err != nil {
164- return fmt .Errorf ("error renaming file \" %s\" : %w" , file , err )
165- }
163+ err := os .Rename (file , newName )
164+ if err != nil {
165+ return fmt .Errorf ("error renaming file \" %s\" : %w" , file , err )
166166 }
167167 }
168-
169168 return nil
170169}
0 commit comments