Skip to content

Commit

Permalink
Pass multiple values to JF_WORKING_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Nov 21, 2024
1 parent ea2b0b6 commit 8462b52
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions utils/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,14 @@ type Project struct {

func (p *Project) setDefaultsIfNeeded() error {
if len(p.WorkingDirs) == 0 {
workingDir := getTrimmedEnv(WorkingDirectoryEnv)
if workingDir == "" {

workingDirs, _ := readArrayParamFromEnv(WorkingDirectoryEnv, WatchesDelimiter)
if len(workingDirs) == 0 {
// If no working directories are provided, and none exist in the environment variable, we designate the project's root directory as our sole working directory.
// We then execute a recursive scan across the entire project, commencing from the root.
workingDir = RootDir
workingDirs = []string{RootDir}
p.IsRecursiveScan = true
}
p.WorkingDirs = append(p.WorkingDirs, workingDir)
p.WorkingDirs = append(p.WorkingDirs, workingDirs...)
}
if len(p.PathExclusions) == 0 {
if p.PathExclusions, _ = readArrayParamFromEnv(PathExclusionsEnv, ";"); len(p.PathExclusions) == 0 {
Expand Down

0 comments on commit 8462b52

Please sign in to comment.