~sircmpwn/pass-rotate

5155c94211aea768630aa98ccb7363d1ae900134 — Drew DeVault 3 years ago bf7ae16 + 2b14cd7
Merge pull request #38 from AbstractBeliefs/xdg-config-home

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()