From 3d4eceedc625c50842cf535e811a9126efa3d6c9 Mon Sep 17 00:00:00 2001 From: Arisu Tachibana Date: Tue, 21 Jan 2025 23:34:27 +0900 Subject: [PATCH] config: Fix example configuration path Both of the pypi and poetry path was pointing to the same poetry path. This was giving a not found error in the case of kci-dev not using poetry. Also normalized both path. Signed-off-by: Arisu Tachibana --- kcidev/subcommands/config.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kcidev/subcommands/config.py b/kcidev/subcommands/config.py index b5899c8..e75df22 100644 --- a/kcidev/subcommands/config.py +++ b/kcidev/subcommands/config.py @@ -49,7 +49,9 @@ def add_config(fpath): poetry_example_configuration = os.path.join( os.path.dirname(__file__), "../..", example_configuration ) - if os.path.exists(poetry_example_configuration): + poetry_example_configuration = os.path.normpath(poetry_example_configuration) + if os.path.isfile(poetry_example_configuration): + kci_msg("here1") config = True if not os.path.exists(dpath) and dpath != "": # copy config @@ -60,12 +62,14 @@ def add_config(fpath): pypi_example_configuration = os.path.join( os.path.dirname(__file__), "..", example_configuration ) - if os.path.exists(pypi_example_configuration): + pypi_example_configuration = os.path.normpath(pypi_example_configuration) + if os.path.isfile(pypi_example_configuration): + kci_msg("here2") config = True if not os.path.exists(dpath) and dpath != "": # copy config os.makedirs(dpath) - shutil.copyfile(poetry_example_configuration, fpath) + shutil.copyfile(pypi_example_configuration, fpath) if not config: kci_err(f"No template configfile found at:")