summaryrefslogtreecommitdiff
path: root/subplot/clab.py
blob: 94b2e514c9a51e5171d827551e7241575390f10e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import io
import os
import yaml


def install_clab(ctx):
    runcmd_prepend_to_path = globals()["runcmd_prepend_to_path"]
    srcdir = globals()["srcdir"]

    # Add the directory with built Rust binaries to the path.
    runcmd_prepend_to_path(ctx, dirname=os.path.join(srcdir, "target", "debug"))


def stdout_is_yaml(ctx):
    runcmd_get_stdout = globals()["runcmd_get_stdout"]
    stdout = runcmd_get_stdout(ctx)
    yaml.safe_load(io.StringIO(stdout))