From d8ac24bcc66fce3aed326bf555636b58b04d5b19 Mon Sep 17 00:00:00 2001 From: Maas Lalani Date: Thu, 7 Jul 2022 22:39:28 -0400 Subject: [PATCH] fix: ignore `node_modules` by default --- internal/files/files.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/internal/files/files.go b/internal/files/files.go index 452417f..fd40517 100644 --- a/internal/files/files.go +++ b/internal/files/files.go @@ -26,12 +26,13 @@ func List() []string { } +var defaultIgnorePatterns = []string{"node_modules", ".git", "."} + func shouldIgnore(path string) bool { - if strings.HasPrefix(path, ".git") { - return true - } - if strings.HasPrefix(path, ".") { - return true + for _, prefix := range defaultIgnorePatterns { + if strings.HasPrefix(path, prefix) { + return true + } } return false }