Skip to content

Commit 4d5793f

Browse files
committed
Make source files refering to directories work
aspect_rules_js seems to use this to bring in source files belonging to NPM packages. Let's generalize fileAndDependenciesCopier, so that it can be used both for files and target action outputs.
1 parent a996fb9 commit 4d5793f

3 files changed

Lines changed: 494 additions & 167 deletions

File tree

pkg/model/analysis/file_properties_value.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ func (r *reposFilePropertiesResolver[TReference, TMetadata]) setCurrentRepo(name
6464
}
6565

6666
func (r *reposFilePropertiesResolver[TReference, TMetadata]) OnDirectory(name path.Component) (path.GotDirectoryOrSymlink, error) {
67+
if r.currentRepo != nil {
68+
return r.currentRepo.OnDirectory(name)
69+
}
6770
if err := r.setCurrentRepo(name.String()); err != nil {
6871
return nil, err
6972
}
@@ -78,6 +81,9 @@ func (r *reposFilePropertiesResolver[TReference, TMetadata]) OnTerminal(name pat
7881
}
7982

8083
func (r *reposFilePropertiesResolver[TReference, TMetadata]) OnUp() (path.ComponentWalker, error) {
84+
if r.currentRepo != nil {
85+
return r.currentRepo.OnUp()
86+
}
8187
return nil, errors.New("path escapes repositories directory")
8288
}
8389

0 commit comments

Comments
 (0)