From de15e817038836aadef25818e1e055e84f3e9d95 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 7 Apr 2021 16:55:44 +0200 Subject: [PATCH] Fixed #21 - Added logic to automatically add 'src' to path in generate command --- src/cpl_cli/command/generate_service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cpl_cli/command/generate_service.py b/src/cpl_cli/command/generate_service.py index 7a084e6e..e7e32652 100644 --- a/src/cpl_cli/command/generate_service.py +++ b/src/cpl_cli/command/generate_service.py @@ -102,6 +102,9 @@ class GenerateService(CommandABC): rel_path = '/'.join(parts[:-1]) class_name = parts[len(parts) - 1] + if 'src' not in name: + rel_path = f'src/{rel_path}' + template = template(class_name, schematic, self._schematics[schematic]["Upper"], rel_path) file_path = os.path.join(self._env.working_directory, template.path, template.name)