summaryrefslogtreecommitdiff
path: root/tools/cargo_publish.py
blob: b8fa1f0376491507eb8ee0ea11c50e2e033ba18c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
import os
import sys
import argparse
from util import run, root_path


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("--dry-run", action="store_true")
    args = parser.parse_args()

    cargo_publish = ["cargo", "publish"]
    if args.dry_run:
        cargo_publish += ["--dry-run"]

    os.chdir(os.path.join(root_path, "core"))
    run(cargo_publish)

    os.chdir(os.path.join(root_path, "deno_typescript"))
    run(cargo_publish)

    os.chdir(os.path.join(root_path, "cli"))
    run(cargo_publish)


if __name__ == '__main__':
    sys.exit(main())