2022-03-16 09:04:38 +01:00
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
|
2022-03-16 09:21:48 +01:00
|
|
|
default_module_configs = os.path.join(os.path.dirname(os.path.realpath(__file__)), '.', 'configs')
|
2022-03-16 09:04:38 +01:00
|
|
|
|
|
|
|
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))
|
|
|
|
|