Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduchesne committed Jun 26, 2023
1 parent 2cc33a4 commit 8c33773
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/jsonnet/find_importers.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func FindImporterForFiles(root string, files []string) ([]string, error) {
importers := map[string]struct{}{}

// Handle files prefixed with `deleted:`. They need to be made absolute and we shouldn't try to find symlinks for them
var existingFiles, deletedFiles []string
var filesToCheck, existingFiles []string
for _, file := range files {
if strings.HasPrefix(file, "deleted:") {
file = strings.TrimPrefix(file, "deleted:")
Expand All @@ -45,8 +45,8 @@ func FindImporterForFiles(root string, files []string) ([]string, error) {
if err != nil {
return nil, err
}
deletedFiles = append(deletedFiles, absFilePath)
deletedFiles = append(deletedFiles, filepath.Clean(filepath.Join(root, file)))
filesToCheck = append(filesToCheck, absFilePath)
filesToCheck = append(filesToCheck, filepath.Clean(filepath.Join(root, file)))
}
continue
}
Expand All @@ -57,11 +57,10 @@ func FindImporterForFiles(root string, files []string) ([]string, error) {
if existingFiles, err = expandSymlinksInFiles(root, existingFiles); err != nil {
return nil, err
}

files = append(existingFiles, deletedFiles...)
filesToCheck = append(filesToCheck, existingFiles...)

// Loop through all given files and add their importers to the list
for _, file := range files {
for _, file := range filesToCheck {
if filepath.Base(file) == jpath.DefaultEntrypoint {
importers[file] = struct{}{}
}
Expand Down

0 comments on commit 8c33773

Please sign in to comment.