diff --git a/main.py b/main.py index 798f765..1ab3e08 100644 --- a/main.py +++ b/main.py @@ -6,16 +6,18 @@ import os from pathlib import Path import shutil +# parse arguments parser = argparse.ArgumentParser(description="parse netlist and pack all references to current working directory") parser.add_argument("files", nargs="*", type=argparse.FileType("r"), default=sys.stdin) parser.add_argument("-d", action="store_const", const=True, default=False, help="Dryrun") args = parser.parse_args() -print(args.d) fileregex = re.compile(r"(? {files[file]}") exit(0) + +# copy all files found in netlist earlier for file in files: src = Path(file) dst = Path(files[file]) if not src.exists(): - # create dir print(f"src does not exist: {str(src)}") continue + # create directory dst.parent.mkdir(parents=True, exist_ok=True) - - print(file, files[file]) - shutil.copyfile(src, dst) +