From c51d34a7bfe8d7e8628e6b203de8bcd117e61136 Mon Sep 17 00:00:00 2001 From: madhatguy Date: Sun, 7 Feb 2021 02:43:35 +0200 Subject: [PATCH] Update cli.py --- cbpi/cli.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cbpi/cli.py b/cbpi/cli.py index 15ef036..2e5218d 100644 --- a/cbpi/cli.py +++ b/cbpi/cli.py @@ -23,33 +23,33 @@ MAIN_DIR = "." def create_config_file(): if os.path.exists(os.path.join(MAIN_DIR, 'config', "config.yaml")) is False: - srcfile = os.path.join(MAIN_DIR, "config", "config.yaml") + srcfile = os.path.join(os.path.dirname(__file__), "config", "config.yaml") destfile = os.path.join(MAIN_DIR, 'config') shutil.copy(srcfile, destfile) print("Config Folder created") if os.path.exists(os.path.join(MAIN_DIR, 'config', "actor.json")) is False: - srcfile = os.path.join(MAIN_DIR, "config", "actor.json") + srcfile = os.path.join(os.path.dirname(__file__), "config", "actor.json") destfile = os.path.join(MAIN_DIR, 'config') shutil.copy(srcfile, destfile) if os.path.exists(os.path.join(MAIN_DIR, 'config', "sensor.json")) is False: - srcfile = os.path.join(MAIN_DIR, "config", "sensor.json") + srcfile = os.path.join(os.path.dirname(__file__), "config", "sensor.json") destfile = os.path.join(MAIN_DIR, 'config') shutil.copy(srcfile, destfile) if os.path.exists(os.path.join(MAIN_DIR, 'config', "kettle.json")) is False: - srcfile = os.path.join(MAIN_DIR, "config", "kettle.json") + srcfile = os.path.join(os.path.dirname(__file__), "config", "kettle.json") destfile = os.path.join(MAIN_DIR, 'config') shutil.copy(srcfile, destfile) if os.path.exists(os.path.join(MAIN_DIR, 'config', "step_data.json")) is False: - srcfile = os.path.join(MAIN_DIR, "config", "step_data.json") + srcfile = os.path.join(os.path.dirname(__file__), "config", "step_data.json") destfile = os.path.join(MAIN_DIR, 'config') shutil.copy(srcfile, destfile) if os.path.exists(os.path.join(MAIN_DIR, 'config', "dashboard", "cbpi_dashboard_1.json")) is False: - srcfile = os.path.join(MAIN_DIR, "config", "dashboard", "cbpi_dashboard_1.json") + srcfile = os.path.join(os.path.dirname(__file__), "config", "dashboard", "cbpi_dashboard_1.json") destfile = os.path.join(MAIN_DIR, "config", "dashboard") shutil.copy(srcfile, destfile)