assemblers: resurrect io.weldr.targz

This was dropped in cebed27cd. However, a tar of a tree is useful in its
own right as an output format.
This commit is contained in:
Lars Karlitski 2019-07-07 20:19:41 +02:00 committed by Tom Gundersen
parent 34d620feea
commit e9fb1ded15

15
assemblers/io.weldr.targz Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/python3
import json
import subprocess
import sys
def main(tree, output_dir, options):
filename = options["filename"]
subprocess.run(["tar", "-czf", f"{output_dir}/{filename}", "-C", tree, "."], stdout=subprocess.DEVNULL, check=True)
if __name__ == '__main__':
args = json.load(sys.stdin)
r = main(args["tree"], args["output_dir"], args["options"])
sys.exit(r)