cic-cli/cic/config.py
William Luke f4e370cb5d
All checks were successful
continuous-integration/drone/push Build is passing
feat: copy base configs to user configs
2022-03-16 11:04:38 +03:00

16 lines
512 B
Python

import os
import shutil
default_module_configs = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'config')
def ensure_base_configs(config_dir: str):
"""
Ensure that the base configs are present.
"""
if not os.path.exists(config_dir):
os.makedirs(config_dir)
for f in os.listdir(default_module_configs):
if not os.path.exists(os.path.join(config_dir, f)):
shutil.copytree(os.path.join(default_module_configs, f), os.path.join(config_dir, f))