@@ -598,7 +598,7 @@ func createHclProject(defaultWorkflow string, defaultApplyRequirements []string,
598598}
599599
600600// Finds the absolute paths of all terragrunt.hcl files
601- func getAllTerragruntFiles (filterPaths [] string , projectHclFiles []string , path string ) ([]string , error ) {
601+ func getAllTerragruntFiles (filterPath string , projectHclFiles []string , path string ) ([]string , error ) {
602602 options , err := options .NewTerragruntOptionsWithConfigPath (path )
603603 if err != nil {
604604 return nil , err
@@ -610,15 +610,11 @@ func getAllTerragruntFiles(filterPaths []string, projectHclFiles []string, path
610610 workingPaths := []string {path }
611611
612612 // filters are not working (yet) if using project hcl files (which are kind of filters by themselves)
613- if len (filterPaths ) > 0 && len (projectHclFiles ) == 0 {
614- workingPaths = []string {}
615- for _ , filterPath := range filterPaths {
616- // get all matching folders
617- theseWorkingPaths , err := filepath .Glob (filterPath )
618- if err != nil {
619- return nil , err
620- }
621- workingPaths = append (workingPaths , theseWorkingPaths ... )
613+ if filterPath != "" && len (projectHclFiles ) == 0 {
614+ // get all matching folders
615+ workingPaths , err = filepath .Glob (filterPath )
616+ if err != nil {
617+ return nil , err
622618 }
623619 }
624620
@@ -682,7 +678,7 @@ func getAllTerragruntProjectHclFiles(projectHclFiles []string, gitRoot string) m
682678 return uniqueHclFileAbsPaths
683679}
684680
685- func Parse (gitRoot string , projectHclFiles []string , createHclProjectExternalChilds bool , autoMerge bool , parallel bool , filterPaths [] string , createHclProjectChilds bool , ignoreParentTerragrunt bool , ignoreDependencyBlocks bool , cascadeDependencies bool , defaultWorkflow string , defaultApplyRequirements []string , autoPlan bool , defaultTerraformVersion string , createProjectName bool , createWorkspace bool , preserveProjects bool , useProjectMarkers bool , executionOrderGroups bool , triggerProjectsFromDirOnly bool ) (* AtlantisConfig , map [string ][]string , error ) {
681+ func Parse (gitRoot string , projectHclFiles []string , createHclProjectExternalChilds bool , autoMerge bool , parallel bool , filterPath string , createHclProjectChilds bool , ignoreParentTerragrunt bool , ignoreDependencyBlocks bool , cascadeDependencies bool , defaultWorkflow string , defaultApplyRequirements []string , autoPlan bool , defaultTerraformVersion string , createProjectName bool , createWorkspace bool , preserveProjects bool , useProjectMarkers bool , executionOrderGroups bool , triggerProjectsFromDirOnly bool ) (* AtlantisConfig , map [string ][]string , error ) {
686682 // Ensure the gitRoot has a trailing slash and is an absolute path
687683 absoluteGitRoot , err := filepath .Abs (gitRoot )
688684 if err != nil {
@@ -718,7 +714,7 @@ func Parse(gitRoot string, projectHclFiles []string, createHclProjectExternalChi
718714 sem := semaphore .NewWeighted (10 )
719715 projectDependenciesMap := sync.Map {}
720716 for _ , workingDir := range workingDirs {
721- terragruntFiles , err := getAllTerragruntFiles (filterPaths , projectHclFiles , workingDir )
717+ terragruntFiles , err := getAllTerragruntFiles (filterPath , projectHclFiles , workingDir )
722718 if err != nil {
723719 return nil , nil , err
724720 }
0 commit comments