stages/targz: add a targz stage

This generates a tarball of the tree.

Signed-off-by: Tom Gundersen <teg@jklm.no>
This commit is contained in:
Tom Gundersen 2019-06-12 18:55:49 +02:00
parent 34de8e0274
commit 35917303c8

12
stages/io.weldr.targz Executable file
View file

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