Commit aa15ed9d authored by Alexandre Pere's avatar Alexandre Pere
Browse files

Fixes bug

parent ea619fdb
......@@ -32,7 +32,6 @@ use tracing::{self, info, error, debug};
/// Executes a single execution of the script with the command arguments and returns exit code.
pub fn exec(matches: clap::ArgMatches) -> Result<Exit, Exit>{
// We initialize the logger
......@@ -60,7 +59,10 @@ pub fn exec(matches: clap::ArgMatches) -> Result<Exit, Exit>{
push_env(&mut store, "RUNAWAY_LEAVE", format!("{}", leave));
debug!("Leave option set to {}", leave);
let parameters = matches.value_of("ARGUMENTS").unwrap_or("").to_owned();
let parameters = match matches.values_of("ARGUMENTS"){
Some(it) => it.fold(String::new(), |acc, arg| format!("{} {}", acc, arg)),
None => "".to_owned()
push_env(&mut store, "RUNAWAY_ARGUMENTS", parameters.clone());
debug!("Arguments set to {}", parameters);
let script = PathBuf::from(matches.value_of("SCRIPT").unwrap());
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment