summaryrefslogtreecommitdiff
path: root/subplot
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-09-19 18:01:47 +0300
committerLars Wirzenius <liw@liw.fi>2021-09-19 18:01:47 +0300
commit832658d9326656d81242ef8dda81f577c20914c6 (patch)
tree13a5982c8f46719d7022f9696e934d97753b84f7 /subplot
parent3badce737414a95836da7a3ebbdf5e86f5d3122a (diff)
downloadclab-832658d9326656d81242ef8dda81f577c20914c6.tar.gz
fix: work with current Subplot, and with user-defined cargo target
Sponsored-by: author
Diffstat (limited to 'subplot')
-rw-r--r--subplot/clab.py5
-rw-r--r--subplot/clab.yaml8
2 files changed, 10 insertions, 3 deletions
diff --git a/subplot/clab.py b/subplot/clab.py
index 94b2e51..a16a5b8 100644
--- a/subplot/clab.py
+++ b/subplot/clab.py
@@ -8,7 +8,10 @@ def install_clab(ctx):
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"))
+ default_target = os.path.join(srcdir, "target")
+ target = os.environ.get("CARGO_TARGET_DIR", default_target)
+ runcmd_prepend_to_path(ctx, dirname=os.path.join(target, "debug"))
+ ctx["server-binary"] = os.path.join(target, "debug", "obnam-server")
def stdout_is_yaml(ctx):
diff --git a/subplot/clab.yaml b/subplot/clab.yaml
index 7e013ff..9eeb26e 100644
--- a/subplot/clab.yaml
+++ b/subplot/clab.yaml
@@ -1,5 +1,9 @@
- given: "an installed clab"
- function: install_clab
+ impl:
+ python:
+ function: install_clab
- then: "stdout is valid YAML"
- function: stdout_is_yaml
+ impl:
+ python:
+ function: stdout_is_yaml