From 6d5ae7c272d0c0f57872b1735e9677f8b7d7ffd1 Mon Sep 17 00:00:00 2001 From: Grzegorz Latosinski Date: Tue, 17 Nov 2020 10:13:32 +0100 Subject: [PATCH] Added possibility to overwrite existing symbol.svg files Signed-off-by: Grzegorz Latosinski --- .../skywater_pdk/generate_symbolator_plots.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/python-skywater-pdk/skywater_pdk/generate_symbolator_plots.py b/scripts/python-skywater-pdk/skywater_pdk/generate_symbolator_plots.py index 1295e39..8d615b4 100644 --- a/scripts/python-skywater-pdk/skywater_pdk/generate_symbolator_plots.py +++ b/scripts/python-skywater-pdk/skywater_pdk/generate_symbolator_plots.py @@ -47,6 +47,11 @@ def main(argv): help='Path to files for which Symbolator failed to generate diagram', type=Path ) + parser.add_argument( + '--overwrite-existing', + help='If present, the script will overwrite existing symbol.svg files', + action='store_true' + ) args = parser.parse_args(argv[1:]) @@ -79,7 +84,7 @@ def main(argv): print('Run the script with --create-dirs') return errno.ENOENT - if out_filename.exists(): + if out_filename.exists() and not args.overwrite_existing: print(f'The {out_filename} already exists') return errno.EEXIST