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:
parent
34de8e0274
commit
35917303c8
1 changed files with 12 additions and 0 deletions
12
stages/io.weldr.targz
Executable file
12
stages/io.weldr.targz
Executable 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))
|
||||
Loading…
Add table
Add a link
Reference in a new issue