fix: Add support for legacy containerfiles and modules containerfiles
This commit is contained in:
parent
85aadf73e5
commit
b1b2b0b2ac
1 changed files with 6 additions and 0 deletions
|
|
@ -106,10 +106,16 @@ pub fn setup_tera(recipe: String, containerfile: Option<PathBuf>) -> Result<(Ter
|
||||||
|args: &HashMap<String, tera::Value>| -> tera::Result<tera::Value> {
|
|args: &HashMap<String, tera::Value>| -> tera::Result<tera::Value> {
|
||||||
match args.get("containerfile") {
|
match args.get("containerfile") {
|
||||||
Some(v) => match v.as_str() {
|
Some(v) => match v.as_str() {
|
||||||
|
#[cfg(feature = "legacy")]
|
||||||
Some(containerfile) => Ok(read_to_string(format!(
|
Some(containerfile) => Ok(read_to_string(format!(
|
||||||
"containerfiles/{containerfile}/Containerfile"
|
"containerfiles/{containerfile}/Containerfile"
|
||||||
))?
|
))?
|
||||||
.into()),
|
.into()),
|
||||||
|
#[cfg(feature = "modules")]
|
||||||
|
Some(containerfile) => Ok(read_to_string(format!(
|
||||||
|
"config/containerfiles/{containerfile}/Containerfile"
|
||||||
|
))?
|
||||||
|
.into()),
|
||||||
None => Err("Arg containerfile wasn't a string".into()),
|
None => Err("Arg containerfile wasn't a string".into()),
|
||||||
},
|
},
|
||||||
None => Err("Needs the argument 'containerfile'".into()),
|
None => Err("Needs the argument 'containerfile'".into()),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue