Skip to content

Commit

Permalink
Gitignore via cli
Browse files Browse the repository at this point in the history
  • Loading branch information
atterpac committed Nov 24, 2023
1 parent d8d9fd1 commit 9f793e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ dir = [".git", "node_modules", "newdir"]
file = [".DS_Store", ".gitignore", ".gitkeep", "newfile.go"]
# File extensions to ignore
extension = [".db", ".sqlite"]
# Add .gitignore paths to ignore
git_ignore = true
```

### Alternatives
Expand Down
3 changes: 3 additions & 0 deletions cmd/refresh/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func main() {
var debounce string
var watch *refresh.Engine
var versFlag bool
var gitIgnore bool

// Ignore
var ignoreDir string
Expand All @@ -41,6 +42,7 @@ func main() {
flag.StringVar(&ignoreExt, "ie", "", "Ignore Extension list as comma-separated list")
flag.StringVar(&debounce, "d", "1000", "Debounce time in milliseconds")
flag.BoolVar(&versFlag, "v", false, "Print version")
flag.BoolVar(&gitIgnore, "git", false, "Read from .gitignore")
flag.Parse()

if versFlag {
Expand All @@ -56,6 +58,7 @@ func main() {
File: stringSliceToMap(strings.Split(ignoreFile, ",")),
Dir: stringSliceToMap(strings.Split(ignoreDir, ",")),
Extension: stringSliceToMap(strings.Split(ignoreExt, ",")),
IgnoreGit: gitIgnore,
}
debounceThreshold, err := strconv.Atoi(debounce)
if err != nil {
Expand Down

0 comments on commit 9f793e1

Please sign in to comment.