mirror of
https://github.com/harvard-lil/data-vault.git
synced 2025-03-16 16:01:21 +00:00
13 lines
356 B
Python
13 lines
356 B
Python
|
import json
|
||
|
import os
|
||
|
from pathlib import Path
|
||
|
|
||
|
CONFIG_PATH = (os.environ.get("XDG_CONFIG_HOME") or (Path.home() / ".config")) / "data-mirror" / "config.json"
|
||
|
|
||
|
def load_config():
|
||
|
"""Load configuration from config file."""
|
||
|
if CONFIG_PATH.exists():
|
||
|
config = json.loads(CONFIG_PATH.read_text())
|
||
|
else:
|
||
|
config = {}
|
||
|
return config
|