Skip to content

Commit aa83821

Browse files
İsmet BALATibalat
İsmet BALAT
authored andcommitted
feat: Add recursive directory check for --restrict-file-list
1 parent 71944ca commit aa83821

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

server/events/project_command_builder.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,10 @@ func (p *DefaultProjectCommandBuilder) buildProjectPlanCommand(ctx *command.Cont
629629
foundDir := false
630630

631631
for _, f := range modifiedFiles {
632-
if filepath.Dir(f) == cmd.RepoRelDir {
632+
// Check if the file is in the directory or any subdirectory of the target
633+
if strings.HasPrefix(filepath.Dir(f), cmd.RepoRelDir) {
633634
foundDir = true
635+
break
634636
}
635637
}
636638

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

656658
for _, p := range repoCfgProjects {
657-
if filepath.Dir(f) == p.Dir {
659+
// Check if the file is in the directory or any subdirectory of the project directory
660+
if strings.HasPrefix(filepath.Dir(f), p.Dir) {
658661
foundDir = true
662+
break
659663
}
660664
}
661665

0 commit comments

Comments
 (0)