resume.js/build.py

20 lines
495 B
Python
Raw Normal View History

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