Commit graph

25 commits

Author SHA1 Message Date
Sam Coe
e6ad8a10d0
Add support for XDG_DATA_HOME 2021-06-02 09:46:14 -04:00
Sam Coe
1d7ffc2013
Add support for LocalAppData and .local/state/ fallback 2021-06-01 15:50:10 -04:00
Sam Coe
602167c0c7
Address PR comments 2021-05-26 11:28:58 -04:00
Sam Coe
583e74d70c
Add support for XDG_STATE_HOME 2021-05-25 16:30:51 -04:00
Sam Coe
972d5ff5f0
Fix test that was deleting local config folder 2021-05-24 18:35:37 -04:00
Sam Coe
0d49bfba42
Add support for XDG_CONFIG_HOME and AppData on Windows 2021-05-24 16:13:33 -04:00
Mislav Marohnić
e0e25c82ff Fix creating Windows directory for gh config 2021-05-19 17:13:12 +02:00
Mislav Marohnić
c6c3e72f43 Unexport StubConfig 2021-04-22 11:42:28 +02:00
Sam Coe
85a6267810
Remove last hardcoded config paths and fix tests 2021-01-25 11:43:37 -08:00
Kevin McDermott
d54a7618d4
Configuration path can come from environment.
This adds support for using the GH_CONFIG_DIR environment variable to determine
where the config files are written, this is useful for cases where the homedir
is not writable.
2021-01-25 10:07:54 -08:00
Mislav Marohnić
75ebb863e3 Use testify assertions for error matching 2021-01-19 13:59:37 +01:00
Cristian Dominguez
45f4a1f087 Equal: flip arguments position 2021-01-18 21:00:59 -03:00
Cristian Dominguez
3afb1d0b1a Use Testify assertions in test 2021-01-16 19:19:30 -03:00
Josh Soref
c8b9486fd3 spelling: nonexistent 2020-11-21 21:43:51 -05:00
Mislav Marohnić
c643778701 Have only one test assert default config rendering 2020-09-16 16:10:53 +02:00
vilmibm
1073c97409 review feedback 2020-09-11 11:36:24 -05:00
vilmibm
79b5ca2cd6 update default config test values 2020-09-10 12:13:48 -05:00
Mislav Marohnić
7908c214df Avoid erroring when looking up config keys for nonexistent host 2020-08-12 15:33:26 +02:00
Mislav Marohnić
569645a050 Support hosts.yml existing while config.yml does not
After a person copies `hosts.yml` to a headless system, they will still
be forced to go through re-authentication flow unless they copy or
initialize a `config.yml` as well. This fixes respecting authentication
info from `hosts.yml` even if `config.yml` is missing.
2020-07-01 14:34:44 +02:00
vilmibm
64a7fd4200 test default configuration 2020-06-11 14:04:41 -05:00
Mislav Marohnić
c08d4f0697 Write all per-host config entries to hosts.yml
Read from and write to the `hosts.yml` file every time `config.yml` is
accessed. Everything that before went under the `hosts:` map now belongs
to `hosts.yml`.
2020-06-02 15:35:13 +02:00
Mislav Marohnić
bad138e448 Enable reading from and writing to empty config files 2020-06-02 13:24:46 +02:00
Mislav Marohnić
fd7b87f3fa Allow writing host-specific keys in a blank config 2020-06-02 13:23:03 +02:00
Mislav Marohnić
f42c9d4b2d Allow stubbing multiple config files 2020-06-02 13:19:21 +02:00
vilmibm
c4693077aa move config stuff to its own package 2020-04-20 13:57:16 -05:00
Renamed from context/config_file_test.go (Browse further)