~sircmpwn/pass-rotate

2b14cd7864b060607eaa8fc6c623e9e165a72d6a — Gareth Pulham 3 years ago bf7ae16
Add support for configs under XDG_CONFIG_HOME
1 files changed, 5 insertions(+), 1 deletions(-)

M pass-rotate
M pass-rotate => pass-rotate +5 -1
@@ 51,7 51,11 @@ if args["--list-options"]:
        print(provider.__doc__.rstrip())
    sys.exit()

cfg_path = args.get("--config") or os.path.expanduser("~/.config/pass-rotate.ini")
if os.environ.get("XDG_CONFIG_HOME"):
    xdg_config_location = os.path.join(os.environ.get("XDG_CONFIG_HOME"), "pass-rotate.ini")
else:
    xdg_config_location = None
cfg_path = args.get("--config") or xdg_config_location or os.path.expanduser("~/.config/pass-rotate.ini")
try:
    with open(cfg_path) as f:
        config = ConfigParser()