switch to /g10k or fallback to ~/.cache/g10k , fixes #234#235
Conversation
ekohl
left a comment
There was a problem hiding this comment.
I'm not very familiar with go, but from reading this looks correct to me, assuming checkDirAndCreate behaves like mkdir -p. I see os.MkdirAll so that should be covered.
The only consideration I thought about was root usage, which maybe should use /var/cache but then again: I don't think g10k should ever run as root and drop privileges instead. And previously it always used /tmp/g10k so this is already better for multi user systems.
I see in the README there are a lot of mentions of the cache in README and I wonder if that needs to be updated. On the other hand, it doesn't explicitly mention the default value.
|
@voxpupuli/g10k I'd merge this. Please comment if any objections. |
|
There is a better way available now https://pkg.go.dev/os#UserCacheDir |
|
Oh, added in Go 1.11. That should be very safe to rely on by now. |
bbd2518 to
ef07c92
Compare
Co-Authored-By: Christoph Maser <christoph.maser+github@gmail.com> Signed-off-by: Christoph Maser <christoph.maser+github@gmail.com>
ef07c92 to
e3c6450
Compare
No description provided.