Changed exit() to sys.exit()

This commit is contained in:
2022-01-19 12:44:23 +01:00
parent 61e7b9d684
commit ada3d133df
40 changed files with 81 additions and 78 deletions

View File

@@ -15,7 +15,7 @@ __title__ = 'cpl_cli.command'
__author__ = 'Sven Heidemann'
__license__ = 'MIT'
__copyright__ = 'Copyright (c) 2020 - 2021 sh-edraft.de'
__version__ = '2021.11.0.post2'
__version__ = '2021.11.0.post3'
from collections import namedtuple
@@ -28,4 +28,4 @@ from .publish_service import PublishService
from .version_service import VersionService
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
version_info = VersionInfo(major='2021', minor='11', micro='0.post2')
version_info = VersionInfo(major='2021', minor='11', micro='0.post3')

View File

@@ -1,4 +1,5 @@
import os
import sys
import textwrap
from collections import Callable
@@ -146,7 +147,7 @@ class GenerateService(CommandABC):
if os.path.isfile(file_path):
Console.error(f'{String.first_to_upper(schematic)} already exists!')
exit()
sys.exit()
message = f'Creating {self._env.working_directory}/{template.path}/{template.name}'
if template.path == '':
@@ -169,7 +170,7 @@ class GenerateService(CommandABC):
"""
if len(args) == 0:
self._help('Usage: cpl generate <schematic> [options]')
exit()
sys.exit()
schematic = args[0]
name = self._config.get_configuration(schematic)
@@ -182,4 +183,4 @@ class GenerateService(CommandABC):
else:
self._help('Usage: cpl generate <schematic> [options]')
exit()
sys.exit()