File size: 603 Bytes
5f25733 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | """Copy declared library payloads while keeping a real native-search directory."""
from pathlib import Path
import shutil
import sys
def copy_payloads(locator, pairs):
if len(pairs) % 2:
raise ValueError("library copies require source/destination pairs")
Path(locator).mkdir(parents=True, exist_ok=True)
for source, destination in zip(pairs[::2], pairs[1::2], strict=True):
output = Path(destination)
output.parent.mkdir(parents=True, exist_ok=True)
shutil.copyfile(source, output)
if __name__ == "__main__":
copy_payloads(sys.argv[1], sys.argv[2:])
|