Fixed async handling for new command
This commit is contained in:
@@ -15,11 +15,11 @@ __title__ = 'cpl_cli.source_creator'
|
||||
__author__ = 'Sven Heidemann'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
|
||||
__version__ = '2021.10.3'
|
||||
__version__ = '2021.10.3.post1'
|
||||
|
||||
from collections import namedtuple
|
||||
|
||||
# imports:
|
||||
|
||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3')
|
||||
version_info = VersionInfo(major='2021', minor='10', micro='3.post1')
|
||||
|
||||
@@ -72,6 +72,13 @@ class ConsoleBuilder:
|
||||
:param workspace:
|
||||
:return:
|
||||
"""
|
||||
src_rel_path = ''
|
||||
if '/' in project_name:
|
||||
old_pj_name = project_name
|
||||
parts = project_name.split('/')
|
||||
project_name = parts[len(parts) - 1]
|
||||
src_rel_path = old_pj_name.split(project_name)[0]
|
||||
|
||||
project_name_snake = String.convert_to_snake_case(project_name)
|
||||
|
||||
if workspace is None:
|
||||
|
||||
@@ -73,6 +73,13 @@ class LibraryBuilder:
|
||||
:param workspace:
|
||||
:return:
|
||||
"""
|
||||
src_rel_path = ''
|
||||
if '/' in project_name:
|
||||
old_pj_name = project_name
|
||||
parts = project_name.split('/')
|
||||
project_name = parts[len(parts) - 1]
|
||||
src_rel_path = old_pj_name.split(project_name)[0]
|
||||
|
||||
project_name_snake = String.convert_to_snake_case(project_name)
|
||||
|
||||
if workspace is None:
|
||||
@@ -100,28 +107,29 @@ class LibraryBuilder:
|
||||
if not os.path.isdir(project_path):
|
||||
os.makedirs(project_path)
|
||||
|
||||
src_rel_path = ''
|
||||
src_name = project_name_snake
|
||||
if workspace is None:
|
||||
src_rel_path = os.path.join('src/', src_name)
|
||||
|
||||
if use_application_api:
|
||||
templates.append(ApplicationTemplate(src_name, src_rel_path))
|
||||
templates.append(ApplicationTemplate(
|
||||
src_name, src_rel_path, use_async))
|
||||
|
||||
if use_startup:
|
||||
templates.append(StartupTemplate(src_name, src_rel_path))
|
||||
templates.append(StartupTemplate(
|
||||
src_name, src_rel_path, use_async))
|
||||
templates.append(MainWithApplicationHostAndStartupTemplate(
|
||||
src_name, src_rel_path))
|
||||
src_name, src_rel_path, use_async))
|
||||
else:
|
||||
templates.append(MainWithApplicationBaseTemplate(
|
||||
src_name, src_rel_path))
|
||||
src_name, src_rel_path, use_async))
|
||||
else:
|
||||
if use_service_providing:
|
||||
templates.append(MainWithDependencyInjection(
|
||||
src_name, src_rel_path))
|
||||
src_name, src_rel_path, use_async))
|
||||
else:
|
||||
templates.append(MainWithoutApplicationBaseTemplate(
|
||||
src_name, src_rel_path))
|
||||
src_name, src_rel_path, use_async))
|
||||
|
||||
proj_name = project_name
|
||||
if workspace is not None:
|
||||
|
||||
Reference in New Issue
Block a user