diff options
author | rsiddharth <s@ricketyspace.net> | 2016-11-13 01:14:09 +0000 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2016-11-13 01:14:09 +0000 |
commit | ba6981811e863e9929db87533a88b8ead52f9369 (patch) | |
tree | cd638bae40e8b6b4a1490f1463c598bc7143f204 /gd_diff.py | |
parent | 61a47f6da59efc6369edb6c8562f663bc4c0333d (diff) |
Update `config_dir` function.
Now creates the config directory if it is not already created.
* gd_diff.py (config_dir): Update function.
* tests/test_gd_diff.py (test_config_dir): Update test.
(test_configured_p_yes): Update test.
Diffstat (limited to 'gd_diff.py')
-rw-r--r-- | gd_diff.py | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -212,7 +212,17 @@ def slurp_fields_from_readme(content): def config_dir(): - return os.path.join(os.getenv('HOME'), '.config', 'gns-deb-diff') + """Return the gns-deb-diff config directory. + + As a side effect, the directory is created if it does not exist. + + """ + cd = os.path.join(os.getenv('HOME'), '.config', 'gns-deb-diff') + + if not os.path.isdir(cd): + os.makedirs(cd) + + return cd def config_file(): |