Skip to content

Commit 80d3191

Browse files
chore: fix utils/utils.go / repoDir (#63)
* chore: fix utils/utils.go / repoDir - first, reference $XDG_CACHE_HOME directory to All OS's cache directory - fix: change save directory gibo to gibo/gitignore-boilerplates - fix: compare string change == to string.equalFold * fix: remove XDG_Base from 1st use --------- Co-authored-by: Simon Whitaker <sw@netcetera.org>
1 parent cc17846 commit 80d3191

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils/utils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func RepoDir() string {
1818
if err != nil {
1919
log.Fatalln("gibo can't determine your user cache directory. Please file an issue at https://github.com/simonwhitaker/gibo/issues")
2020
}
21-
return filepath.Join(cacheDir, "gibo")
21+
return filepath.Join(cacheDir, "gibo", "gitignore-boilerplates")
2222
}
2323

2424
func cloneRepo(repo string) error {
@@ -56,7 +56,7 @@ func pathForBoilerplate(name string) (string, error) {
5656
filename := name + ".gitignore"
5757
var result string = ""
5858
filepath.WalkDir(RepoDir(), func(path string, d fs.DirEntry, err error) error {
59-
if strings.ToLower(filepath.Base(path)) == strings.ToLower(filename) {
59+
if strings.EqualFold(filepath.Base(path), filename) {
6060
result = path
6161
// Exit WalkDir early, we've found our match
6262
return filepath.SkipAll

0 commit comments

Comments
 (0)