diff options
author | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
---|---|---|
committer | alexv-smirnov <alex@ydb.tech> | 2023-06-13 11:05:01 +0300 |
commit | bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch) | |
tree | 1d1df72c0541a59a81439842f46d95396d3e7189 /build/scripts/tared_protoc.py | |
parent | 8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff) | |
download | ydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz |
add ymake export to ydb
Diffstat (limited to 'build/scripts/tared_protoc.py')
-rw-r--r-- | build/scripts/tared_protoc.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/build/scripts/tared_protoc.py b/build/scripts/tared_protoc.py new file mode 100644 index 0000000000..7643e1dbfe --- /dev/null +++ b/build/scripts/tared_protoc.py @@ -0,0 +1,31 @@ +import os +import optparse +import tarfile +import contextlib +import subprocess as sp + + +def parse_args(): + parser = optparse.OptionParser() + parser.disable_interspersed_args() + parser.add_option('--tar-output') + parser.add_option('--protoc-out-dir') + return parser.parse_args() + + +def main(): + opts, args = parse_args() + assert opts.tar_output + assert opts.protoc_out_dir + + if not os.path.exists(opts.protoc_out_dir): + os.makedirs(opts.protoc_out_dir) + + sp.check_call(args) + + with contextlib.closing(tarfile.open(opts.tar_output, 'w')) as tf: + tf.add(opts.protoc_out_dir, arcname='') + + +if __name__ == '__main__': + main() |