summaryrefslogtreecommitdiffstats
path: root/gita/common.py
blob: ef3933d682114449340c699a539bd67b7a8fdb6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import os


def get_config_dir() -> str:
    parent = os.environ.get('XDG_CONFIG_HOME') or os.path.join(
        os.path.expanduser('~'), '.config')
    root = os.path.join(parent, "gita")
    return root


def get_config_fname(fname: str) -> str:
    """
    Return the file name that stores the repo locations.
    """
    root = get_config_dir()
    return os.path.join(root, fname)