mirror of
https://github.com/darkclip/netlist.git
synced 2026-11-10 23:37:28 +08:00
update
This commit is contained in:
parent
93e17c23f4
commit
fce66f4725
@ -100,10 +100,11 @@ def run(args: argparse.Namespace) -> None:
|
||||
else:
|
||||
print(f'Included Networks: {len(in_networks)}')
|
||||
output_file = output.resolve()
|
||||
if not output_file.parent.exists():
|
||||
output_file.parent.mkdir(parents=True)
|
||||
if output_file.is_dir():
|
||||
print('Can not write to directory.')
|
||||
sys.exit(1)
|
||||
if not output_file.parent.exists():
|
||||
output_file.parent.mkdir(parents=True)
|
||||
if output_file.exists():
|
||||
with output_file.open('a', encoding='utf-8') as wfp:
|
||||
wfp.writelines(output_lines)
|
||||
|
||||
@ -129,10 +129,11 @@ def run(args: argparse.Namespace) -> None:
|
||||
print(line, end='')
|
||||
else:
|
||||
output_file = output.resolve()
|
||||
if not output_file.parent.exists():
|
||||
output_file.parent.mkdir(parents=True)
|
||||
if output_file.is_dir():
|
||||
print('Can not write to directory.')
|
||||
sys.exit(1)
|
||||
if not output_file.parent.exists():
|
||||
output_file.parent.mkdir(parents=True)
|
||||
if output_file.exists():
|
||||
with output_file.open('a', encoding='utf-8') as wfp:
|
||||
wfp.writelines(output_lines)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user