summaryrefslogtreecommitdiff
path: root/reference.py
blob: 69ad466cfc70cb9175e70357d5cef4b666b2d567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def clone_to_src(ctx, url=None, commit=None):
    runcmd_run = globals()["runcmd_run"]
    runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]

    runcmd_run(ctx, ["git", "clone", url, "src"])
    runcmd_exit_code_is_zero(ctx)

    runcmd_run(ctx, ["git", "checkout", commit], cwd="src")
    runcmd_exit_code_is_zero(ctx)


def docgen(ctx, filename=None, output=None, dirname=None):
    runcmd_run = globals()["runcmd_run"]
    runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"]

    runcmd_run(ctx, ["subplot", "docgen", filename, "--output", output], cwd=dirname)
    runcmd_exit_code_is_zero(ctx)