From 769e803695a996b3f4896bd164b5c7f128a131d6 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Tue, 10 May 2022 14:51:24 -0400 Subject: [PATCH] Write `mkts.yml` from template if one dne --- piker/data/marketstore.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/piker/data/marketstore.py b/piker/data/marketstore.py index fd0e9318..39fe1b70 100644 --- a/piker/data/marketstore.py +++ b/piker/data/marketstore.py @@ -131,6 +131,16 @@ def start_marketstore( get_console_log('info', name=__name__) + yml_file = os.path.join(config._config_dir, 'mkts.yml') + if not os.path.isfile(yml_file): + log.warning( + f'No `marketstore` config exists?: {yml_file}\n' + 'Generating new file from template:\n' + f'{_yaml_config}\n' + ) + with open(yml_file, 'w') as yf: + yf.write(_yaml_config) + # create a mount from user's local piker config dir into container config_dir_mnt = docker.types.Mount( target='/etc',