This commit is contained in:
JT
2022-04-23 11:48:10 +12:00
committed by GitHub
parent 5ff2ae628b
commit cc78446ffd
2 changed files with 41 additions and 45 deletions

View File

@ -531,13 +531,20 @@ pub fn eval_expression(
})
}
Expr::Directory(s) => {
let cwd = current_dir_str(engine_state, stack)?;
let path = expand_path_with(s, cwd);
if s == "-" {
Ok(Value::String {
val: "-".to_string(),
span: expr.span,
})
} else {
let cwd = current_dir_str(engine_state, stack)?;
let path = expand_path_with(s, cwd);
Ok(Value::String {
val: path.to_string_lossy().to_string(),
span: expr.span,
})
Ok(Value::String {
val: path.to_string_lossy().to_string(),
span: expr.span,
})
}
}
Expr::GlobPattern(s) => {
let cwd = current_dir_str(engine_state, stack)?;