Compare commits

..

1 Commits

Author SHA1 Message Date
c17a36ba07 Fix lib name 2023-06-23 23:46:57 -04:00
4 changed files with 3 additions and 43 deletions

View File

@ -1,7 +1,7 @@
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = std::env::args().skip(1).collect::<Vec<String>>().join(" ");
println!("{}", expressive::eval(&args)?);
println!("{}", evalexpr::eval(&args)?);
Ok(())
}

View File

@ -1,7 +1,7 @@
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = std::env::args().skip(1).collect::<Vec<String>>().join(" ");
println!("{}", expressive::eval(&args)?);
println!("{}", evalexpr::eval(&args)?);
Ok(())
}

View File

@ -102,10 +102,7 @@ impl Context for VariableMap {
None
}
} else {
self.variables.get(identifier).or_else(|| {
self.call_function(identifier, &Value::Empty);
None
})
self.variables.get(identifier)
}
}

View File

@ -1,37 +0,0 @@
use crate::Result;
use std::collections::HashMap;
pub fn build(variables: &HashMap<String, Value>) -> Result<Value> {
let name = {
let name = if let Some(value) = variables.get("name") {
format!("--name {}", value)
} else {
String::with_capacity(0)
};
Value::String(name)
};
let image = {
let image = if let Some(value) = variables.get("image") {
format!("--image {}", value)
} else {
String::with_capacity(0)
};
Value::String(image)
};
// let toolbox_command = format!("toolbox create --image {} {}", &image, &name);
// Command::new("fish")
// .arg("-c")
// .arg(&toolbox_command)
// .spawn()
// .unwrap()
// .wait()
// .unwrap();
println!("{} {}", image, name);
Ok(Value::String("Built container.".to_string()))
}