Skip to content

Commit

Permalink
The RecursiveInstall of Filter sturct creates Profiles from filter.js…
Browse files Browse the repository at this point in the history
…on and recursively installs nested filters. Copying the filter data is not implemented yet.
  • Loading branch information
Nusiq committed Jan 13, 2022
1 parent 751b761 commit 23e0783
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion regolith/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ type Filter struct {
// Returns whether the filter is a remote filter or not.
// A remote filter requires installation
func (filter *Filter) IsRemote() bool {
return filter.Filter != ""
return filter.Script == ""
}

// Returns whether the filter is currently installed or not.
Expand Down Expand Up @@ -285,9 +285,22 @@ func (filter *Filter) RecursiveInstall(isForced bool) error {
if err != nil {
return wrapError("Could not download filter: ", err)
}
// Create fake profile from filter.json file to check for nested
// dependencies
profile, err := LoadFiltersFromPath(filterDirectory)
if err != nil {
return fmt.Errorf(
"could not load \"filter.json\" from path %q, while checking"+
" for recursive dependencies", filterDirectory,
)
}
profile.Install(isForced)
}

// Install dependencies
if filter.RunWith == "" {
return nil // No dependencies to install
}
err = filter.DownloadDependencies(filterDirectory)
if err != nil {
return wrapError("Could not download dependencies: ", err)
Expand Down

0 comments on commit 23e0783

Please sign in to comment.