Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix utils/utils.go / repoDir #63

Merged
merged 3 commits into from
Dec 22, 2023
Merged

chore: fix utils/utils.go / repoDir #63

merged 3 commits into from
Dec 22, 2023

Conversation

atsushifx
Copy link
Contributor

  • 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

  - 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
Copy link
Owner

@simonwhitaker simonwhitaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the code for explicitly checking XDG_CACHE_HOME; we can just rely on os.UserCacheDir() here.

utils/utils.go Outdated
cacheDir, err := os.UserCacheDir()
if err != nil {
log.Fatalln("gibo can't determine your user cache directory. Please file an issue at https://github.com/simonwhitaker/gibo/issues")
xdgCacheDir := os.Getenv("XDG_CACHE_HOME")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's your intention here? os.UserCacheDir() will respect XDG_CACHE_HOME on Unix systems. I suppose people on macOS or Windows might set the XDG_CACHE_HOME environment variable, but I don't think it makes sense to try to honour non-standard configs; the logic here would potentially get very complicated, for little benefit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understood. New commit:13959a970eda9e4c61afe6105f176c01f9d14ff5 remove these codes relied XDG_CACHE_HOME.
please check them.

utils/utils.go Show resolved Hide resolved
@simonwhitaker simonwhitaker merged commit 80d3191 into simonwhitaker:main Dec 22, 2023
1 check passed
@atsushifx atsushifx deleted the feat-repoDir-cachedir-xbase branch December 22, 2023 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants