Skip to content

Commit

Permalink
skip node_modules directories
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy committed Aug 29, 2024
1 parent 79e34bb commit 04bf93d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/importpaths/rewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ func Rewrite(dir string, replace ReplaceFunc) error {
if name == dir {
return nil
}
// don't recurse into vendor or testdata directories
if info.Name() == "vendor" || info.Name() == "testdata" {
// don't recurse into vendor, testdata, or node_modules directories
switch info.Name() {
case "vendor", "testdata", "node_modules":
return filepath.SkipDir
}
// don't recurse into underscore-prefix or dot-prefix directories
Expand Down

0 comments on commit 04bf93d

Please sign in to comment.