Files
Nathan Whitehead dafe397a0f Add dockerfile for release builds.
Fix minor build issues related to using old Ubuntu to build.
Add option to use precompiled font.js, Pillow was not working properly in old Python versions.
2022-09-22 14:27:09 -06:00

25 lines
714 B
Python

'''
Bundle any number of files into one generated C include header with xxd.
'''
import argparse
import os
import subprocess
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Bundle sources into one generated output C header file')
parser.add_argument('--inpath')
parser.add_argument('--out')
parser.add_argument('sources', nargs='+')
args = parser.parse_args()
with open(args.out, 'wb') as fout:
if args.inpath:
os.chdir(args.inpath)
out = bytes()
for source in args.sources:
result = subprocess.check_output(' '.join(["xxd", "-i", source]), shell=True)
out += result
fout.write(out)