Commit Graph

5 Commits

Author SHA1 Message Date
Chris Lane efd09575df feat(config): refactor config path detection
Previously, failing other checks, on Unix and BSD systems,
`config.Paths` would attempt to compute the user's home directory by
reading the `HOME` environment variable.

This change deprecates that approach with a call to `homedir.Dir`, which
is used elsewhere throughout the application.
2020-03-05 17:46:49 -05:00
Chris Lane 506fb8be15 fix: XDG_CONFIG_HOME mishandling
Attempts to resolve an issue regarding automatic config file generation,
as referenced in #501. This issue is believed occur when
`XDG_CONFIG_HOME` is unset.
2020-01-30 19:59:35 -05:00
Chris Lane 408e944eea chore: refactors `config.path` (small)
Performs a minor refactoring on `config.Paths` to consistently use
`path.Join` when computing config directory paths. Previously, both
`path.Join` and `fmt.Sprintf` were being used, strictly due to an
oversight.
2020-01-30 19:45:02 -05:00
Chris Lane 6912771c39 chore: refactors `config.Paths`
Refactors the reading of multiple envvars out of `config.Paths` in order
to facilitate cleaner unit-testing.
2020-01-30 18:48:36 -05:00
Chris Lane 313b5ebd27 feat: config auto-generation
`cheat` now attempts to auto-generate a config file if one cannot be
found on the filesystem.
2020-01-29 14:08:03 -05:00