From 20e37c232fc156aa998954a8b76eecfaaec5c338 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Sun, 18 Feb 2024 09:55:45 +0100 Subject: [PATCH] copy a scenarios.yaml from scenarios.template.yaml so it is not git tracked --- Snakefile | 13 +++++++++---- config/{scenarios.yaml => scenarios.template.yaml} | 0 2 files changed, 9 insertions(+), 4 deletions(-) rename config/{scenarios.yaml => scenarios.template.yaml} (100%) diff --git a/Snakefile b/Snakefile index 1c8e1323..4f35dd74 100644 --- a/Snakefile +++ b/Snakefile @@ -16,10 +16,15 @@ from scripts._helpers import path_provider min_version("7.7") HTTP = HTTPRemoteProvider() -conf_file = os.path.join(workflow.current_basedir, "config/config.yaml") -conf_default_file = os.path.join(workflow.current_basedir, "config/config.default.yaml") -if not exists(conf_file) and exists(conf_default_file): - copyfile(conf_default_file, conf_file) +default_files = { + "config/config.default.yaml": "config/config.yaml", + "config/scenarios.template.yaml": "config/scenarios.yaml", +} +for template, target in default_files.items(): + target = os.path.join(workflow.current_basedir, target) + template = os.path.join(workflow.current_basedir, template) + if not exists(target) and exists(template): + copyfile(template, target) configfile: "config/config.default.yaml" configfile: "config/config.yaml" diff --git a/config/scenarios.yaml b/config/scenarios.template.yaml similarity index 100% rename from config/scenarios.yaml rename to config/scenarios.template.yaml