Skip to content

Commit

Permalink
Remove eval args from process.arvg
Browse files Browse the repository at this point in the history
  • Loading branch information
richarddavison committed Nov 23, 2023
1 parent 6585511 commit cb17aa5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ pub fn init(ctx: &Ctx<'_>) -> Result<()> {
hr_time.set("bigint", Func::from(current_time_micros))?;

let env_map: HashMap<String, String> = env::vars().collect();
let args: Vec<String> = env::args().collect();
let mut args: Vec<String> = env::args().collect();

if let Some(arg) = args.get(1) {
if arg == "-e" || arg == "--eval" {
args.remove(1);
args.remove(1);
}
}

process.set("env", env_map)?;
process.set("cwd", Func::from(cwd))?;
Expand Down

0 comments on commit cb17aa5

Please sign in to comment.