Skip to content

Commit

Permalink
Merge pull request tomnomnom#5 from Jab2870/master
Browse files Browse the repository at this point in the history
Adds the ability to store patterns in ~/.config/gf
  • Loading branch information
tomnomnom authored Jun 30, 2019
2 parents f33ebc6 + 3b59b6d commit fe6f7bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ func getPatternDir() (string, error) {
if err != nil {
return "", err
}
path := filepath.Join(usr.HomeDir, ".config/gf")
if _, err := os.Stat(path); !os.IsNotExist(err) {
// .config/gf exists
return path, nil
}
return filepath.Join(usr.HomeDir, ".gf"), nil
}

Expand Down

0 comments on commit fe6f7bb

Please sign in to comment.