Fix path external (#684)

* Fix external invocation/expansion

* clippy
This commit is contained in:
JT 2022-01-06 21:20:31 +11:00 committed by GitHub
parent d39e8c15fe
commit e44789556b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -194,9 +194,14 @@ pub fn parse_external_call(
let name_span = spans[0];
let name = String::from_utf8_lossy(working_set.get_span_contents(name_span)).to_string();
let cwd = working_set.get_cwd();
let name = nu_path::expand_path_with(name, cwd)
let name = if name.starts_with('.') || name.starts_with('~') {
nu_path::expand_path_with(name, cwd)
.to_string_lossy()
.to_string();
.to_string()
} else {
name
};
let mut error = None;
for span in &spans[1..] {