Fix location of config dir

This commit is contained in:
Marcin Kulik
2018-03-03 21:05:43 +01:00
parent 8f7d2fd149
commit 99ebd1685c
2 changed files with 8 additions and 3 deletions

View File

@@ -1,5 +1,9 @@
# asciinema changelog
## develop (unreleased)
* Fixed location of config dir (you can `mv ~/.asciinema ~/.config/asciinema`).
## 2.0 (2018-02-10)
This major release brings many new features, improvements and bugfixes. The most

View File

@@ -131,10 +131,11 @@ def get_config_home(env=os.environ):
elif env_xdg_config_home:
config_home = path.join(env_xdg_config_home, "asciinema")
elif env_home:
if path.isfile(path.join(env_home, ".config", "asciinema", "config")):
config_home = path.join(env_home, ".config", "asciinema")
if path.isfile(path.join(env_home, ".asciinema", "config")):
# location for versions < 1.1
config_home = path.join(env_home, ".asciinema")
else:
config_home = path.join(env_home, ".asciinema") # location for versions < 1.1
config_home = path.join(env_home, ".config", "asciinema")
else:
raise Exception("need $HOME or $XDG_CONFIG_HOME or $ASCIINEMA_CONFIG_HOME")