mirror of
https://github.com/charmbracelet/gum
synced 2024-05-17 21:56:42 +02:00
fix: ignore node_modules
by default
This commit is contained in:
parent
66e01ac849
commit
d8ac24bcc6
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue