Skip to content

Commit

Permalink
Don't Scan Hidden Directories For Snippets
Browse files Browse the repository at this point in the history
When scanning for new snippets, ignore hidden directories.
We don't want to add a .git directory, for example.
  • Loading branch information
cwarden authored and maaslalani committed Apr 1, 2023
1 parent 5f8d5fe commit 26ac8bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ func scanSnippets(config Config, snippets []Snippet) []Snippet {
if !homeEntry.IsDir() {
continue
}
if strings.HasPrefix(homeEntry.Name(), ".") {
continue
}

folderPath := filepath.Join(config.Home, homeEntry.Name())
folderEntries, err := os.ReadDir(folderPath)
Expand Down

0 comments on commit 26ac8bd

Please sign in to comment.