Skip to content

Commit

Permalink
Add option to control the Pnpm dependencies tree depth
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Dec 23, 2024
1 parent 802ca5b commit d901654
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions utils/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const (

// Repository environment variables - Ignored if the frogbot-config.yml file is used
InstallCommandEnv = "JF_INSTALL_DEPS_CMD"
MaxPnpmTreeDepthEnv = "JF_PNPM_MAX_TREE_DEPTH"
RequirementsFileEnv = "JF_REQUIREMENTS_FILE"
WorkingDirectoryEnv = "JF_WORKING_DIR"
PathExclusionsEnv = "JF_PATH_EXCLUSIONS"
Expand Down
5 changes: 5 additions & 0 deletions utils/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ type Project struct {
WorkingDirs []string `yaml:"workingDirs,omitempty"`
PathExclusions []string `yaml:"pathExclusions,omitempty"`
UseWrapper *bool `yaml:"useWrapper,omitempty"`
MaxPnpmTreeDepth string `yaml:"maxPnpmTreeDepth,omitempty"`
DepsRepo string `yaml:"repository,omitempty"`
InstallCommandName string
InstallCommandArgs []string
Expand Down Expand Up @@ -131,6 +132,10 @@ func (p *Project) setDefaultsIfNeeded() error {
if p.DepsRepo == "" {
p.DepsRepo = getTrimmedEnv(DepsRepoEnv)
}
if p.MaxPnpmTreeDepth == "" {
p.MaxPnpmTreeDepth = getTrimmedEnv(MaxPnpmTreeDepthEnv)
}

return nil
}

Expand Down
1 change: 1 addition & 0 deletions utils/scandetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func (sc *ScanDetails) RunInstallAndAudit(workDirs ...string) (auditResults *res
SetXscVersion(sc.XscVersion).
SetPipRequirementsFile(sc.PipRequirementsFile).
SetUseWrapper(*sc.UseWrapper).
SetMaxTreeDepth(sc.MaxPnpmTreeDepth).
SetDepsRepo(sc.DepsRepo).
SetIgnoreConfigFile(true).
SetServerDetails(sc.ServerDetails).
Expand Down

0 comments on commit d901654

Please sign in to comment.