1
0
Fork 0
gita/gita/common.py
Daniel Baumann c872e9becf
Merging upstream version 0.16.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-11 18:50:00 +01:00

17 lines
412 B
Python

import os
def get_config_dir() -> str:
root = (
os.environ.get("GITA_PROJECT_HOME")
or os.environ.get("XDG_CONFIG_HOME")
or os.path.join(os.path.expanduser("~"), ".config")
)
return os.path.join(root, "gita")
def get_config_fname(fname: str) -> str:
"""
Return the file name that stores the repo locations.
"""
return os.path.join(get_config_dir(), fname)