Compare commits

..

No commits in common. "82df52839514146214fcd789b89a4f9effc8b0ca" and "df3f9f0306c844e63fd23a41fc70255da7216bd9" have entirely different histories.

View File

@ -153,24 +153,18 @@ class GenerateService(CommandABC):
if not os.path.isdir(os.path.dirname(file_path)): if not os.path.isdir(os.path.dirname(file_path)):
os.makedirs(os.path.dirname(file_path)) os.makedirs(os.path.dirname(file_path))
directory = '' directory = ''
print()
for subdir in template.path.split('/'): for subdir in template.path.split('/'):
directory = os.path.join(directory, subdir) directory = os.path.join(directory, subdir)
if subdir == 'src': if subdir != 'src':
continue file = InitTemplate(class_name, schematic, self._schematics[schematic]["Upper"], rel_path)
Console.spinner(
file = InitTemplate(class_name, schematic, self._schematics[schematic]["Upper"], rel_path) f'Creating {os.path.abspath(directory)}/{file.name}',
if os.path.exists(os.path.join(os.path.abspath(directory), file.name)): self._create_file,
continue os.path.join(os.path.abspath(directory), file.name),
file.value,
Console.spinner( text_foreground_color=ForegroundColorEnum.green,
f'Creating {os.path.abspath(directory)}/{file.name}', spinner_foreground_color=ForegroundColorEnum.cyan
self._create_file, )
os.path.join(os.path.abspath(directory), file.name),
file.value,
text_foreground_color=ForegroundColorEnum.green,
spinner_foreground_color=ForegroundColorEnum.cyan
)
if os.path.isfile(file_path): if os.path.isfile(file_path):
Console.error(f'{String.first_to_upper(schematic)} already exists!\n') Console.error(f'{String.first_to_upper(schematic)} already exists!\n')