Skip to content

Commit

Permalink
feat: Add recursive directory check for --restrict-file-list
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalat committed Oct 4, 2024
1 parent 71944ca commit aa83821
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/events/project_command_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,10 @@ func (p *DefaultProjectCommandBuilder) buildProjectPlanCommand(ctx *command.Cont
foundDir := false

for _, f := range modifiedFiles {
if filepath.Dir(f) == cmd.RepoRelDir {
// Check if the file is in the directory or any subdirectory of the target
if strings.HasPrefix(filepath.Dir(f), cmd.RepoRelDir) {
foundDir = true
break
}
}

Expand All @@ -654,8 +656,10 @@ func (p *DefaultProjectCommandBuilder) buildProjectPlanCommand(ctx *command.Cont
foundDir := false

for _, p := range repoCfgProjects {
if filepath.Dir(f) == p.Dir {
// Check if the file is in the directory or any subdirectory of the project directory
if strings.HasPrefix(filepath.Dir(f), p.Dir) {
foundDir = true
break
}
}

Expand Down

0 comments on commit aa83821

Please sign in to comment.