Merge pull request #438 from s4Ys369/revert-434-patch-1
[sm64pc.git] / tools / mkzip.py
blob5481bc59e589afaca32bb233b12f172424880c90
1 #!/usr/bin/env python3
3 import sys
4 import os
5 import zipfile
7 if len(sys.argv) < 3:
8 print('usage: mkzip <lstfile> <zipfile>')
9 sys.exit(1)
11 lst = []
12 with open(sys.argv[1], 'r') as f:
13 for line in f:
14 line = line.strip()
15 if line == '' or line[0] == '#':
16 continue
17 tok = line.split()
18 lst.append((tok[0], tok[1]))
20 with zipfile.ZipFile(sys.argv[2], 'w', allowZip64=False) as zipf:
21 for (fname, aname) in lst:
22 zipf.write(fname, arcname=aname)