diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2022-10-22 10:49:59 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2022-10-22 10:49:59 +0100 |
commit | fd6afa6061b36ee8e7cd656afef8f052fe3d75da (patch) | |
tree | 272375a2d67089ae6bc35bc24e838f5470046db6 /share/rust/template/macros.rs.tera | |
parent | 9318464daaee62481f7f80105bc2ec14c9c01e16 (diff) | |
download | subplot-fd6afa6061b36ee8e7cd656afef8f052fe3d75da.tar.gz |
(rust template): Support a 'path' arg type to pass PathBufs in
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'share/rust/template/macros.rs.tera')
-rw-r--r-- | share/rust/template/macros.rs.tera | 5 |
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 %} ) |