mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 19:47:45 +02:00
Path migration 1 (#13309)
# Description Part 1 of replacing `std::path` types with `nu_path` types added in #13115.
This commit is contained in:
@ -39,7 +39,7 @@ On Windows based systems, Nushell will wait for the command to finish and then e
|
||||
let name: Spanned<String> = call.req(engine_state, stack, 0)?;
|
||||
let executable = {
|
||||
let paths = nu_engine::env::path_str(engine_state, stack, call.head)?;
|
||||
let Some(executable) = crate::which(&name.item, &paths, &cwd) else {
|
||||
let Some(executable) = crate::which(&name.item, &paths, cwd.as_ref()) else {
|
||||
return Err(crate::command_not_found(
|
||||
&name.item,
|
||||
call.head,
|
||||
|
@ -79,7 +79,7 @@ impl Command for External {
|
||||
// Determine the PATH to be used and then use `which` to find it - though this has no
|
||||
// effect if it's an absolute path already
|
||||
let paths = nu_engine::env::path_str(engine_state, stack, call.head)?;
|
||||
let Some(executable) = which(expanded_name, &paths, &cwd) else {
|
||||
let Some(executable) = which(expanded_name, &paths, cwd.as_ref()) else {
|
||||
return Err(command_not_found(&name_str, call.head, engine_state, stack));
|
||||
};
|
||||
executable
|
||||
@ -228,7 +228,7 @@ pub fn eval_arguments_from_call(
|
||||
match arg {
|
||||
// Expand globs passed to run-external
|
||||
Value::Glob { val, no_expand, .. } if !no_expand => args.extend(
|
||||
expand_glob(&val, &cwd, expr.span, engine_state.signals())?
|
||||
expand_glob(&val, cwd.as_ref(), expr.span, engine_state.signals())?
|
||||
.into_iter()
|
||||
.map(|s| s.into_spanned(expr.span)),
|
||||
),
|
||||
|
Reference in New Issue
Block a user