summaryrefslogtreecommitdiff
path: root/share/rust/template/macros.rs.tera
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-10-22 11:59:50 +0000
committerLars Wirzenius <liw@liw.fi>2022-10-22 11:59:50 +0000
commit1bcbb535490511e0bc4f2826356a16bdd05360b0 (patch)
tree1e26b5616d61e9fc917278012f75d707bbfd97fa /share/rust/template/macros.rs.tera
parent990c506d347a6aa09af68bc6de670858cf59f133 (diff)
parent7f52ffc37e1a366f78ba3709f15b09ca22ca98c9 (diff)
downloadsubplot-1bcbb535490511e0bc4f2826356a16bdd05360b0.tar.gz
Merge branch 'filepath-as-path' into 'main'
(derive): Support steps with &Path arguments Closes #288 See merge request subplot/subplot!295
Diffstat (limited to 'share/rust/template/macros.rs.tera')
-rw-r--r--share/rust/template/macros.rs.tera5
1 files changed, 3 insertions, 2 deletions
diff --git a/share/rust/template/macros.rs.tera b/share/rust/template/macros.rs.tera
index 7a65e0f..104eb23 100644
--- a/share/rust/template/macros.rs.tera
+++ b/share/rust/template/macros.rs.tera
@@ -8,8 +8,7 @@
{% if type in ['number', 'int', 'uint'] %}{{text}}
{%- elif type in ['text', 'word']%}
// "{{text | commentsafe }}"
- &base64_decode("{{text | base64}}"
- )
+ &base64_decode("{{text | base64}}")
{%- elif type in ['file'] %}
{
use std::path::PathBuf;
@@ -21,6 +20,8 @@
.expect("Unable to find file at runtime")
.clone()
}
+ {%- elif type in ['path'] %}
+ std::path::PathBuf::from(base64_decode("{{ text | base64 }}"))
{%- else %} /* WOAH unknown type {{step.types[name]}} */ {{text}}
{%- endif %}
)