pass args to build command

This commit is contained in:
b1ek 2023-03-23 07:45:26 +10:00
parent 7277b2a158
commit 0452f4dafd
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 4 additions and 2 deletions

View File

@ -1,9 +1,11 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import json, os import json, os, sys
package = {} package = {}
argv = ' '.join(sys.argv[1:])
with open('package.json', 'r+', encoding='utf-8') as f: with open('package.json', 'r+', encoding='utf-8') as f:
package = json.loads(f.read()); package = json.loads(f.read());
f.seek(0); f.seek(0);
@ -11,7 +13,7 @@ with open('package.json', 'r+', encoding='utf-8') as f:
f.truncate(0); f.truncate(0);
f.write(json.dumps(package, indent=2) + '\n'); f.write(json.dumps(package, indent=2) + '\n');
os.system('parcel build'); os.system('parcel build ' + argv);
with open('package.json', 'w+', encoding='utf-8') as f: with open('package.json', 'w+', encoding='utf-8') as f:
package['source'] = 'src/resume.html'; package['source'] = 'src/resume.html';