Fixed cpl g existing __init__.py overwrite #116
This commit is contained in:
parent
df3f9f0306
commit
49e3bddc91
@ -153,10 +153,16 @@ class GenerateService(CommandABC):
|
||||
if not os.path.isdir(os.path.dirname(file_path)):
|
||||
os.makedirs(os.path.dirname(file_path))
|
||||
directory = ''
|
||||
print()
|
||||
for subdir in template.path.split('/'):
|
||||
directory = os.path.join(directory, subdir)
|
||||
if subdir != 'src':
|
||||
if subdir == 'src':
|
||||
continue
|
||||
|
||||
file = InitTemplate(class_name, schematic, self._schematics[schematic]["Upper"], rel_path)
|
||||
if os.path.exists(os.path.join(os.path.abspath(directory), file.name)):
|
||||
continue
|
||||
|
||||
Console.spinner(
|
||||
f'Creating {os.path.abspath(directory)}/{file.name}',
|
||||
self._create_file,
|
||||
|
Loading…
Reference in New Issue
Block a user