mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 18:27:46 +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:
@ -60,12 +60,13 @@ impl Command for ConfigEnv {
|
||||
let (editor_name, editor_args) = get_editor(engine_state, stack, call.head)?;
|
||||
let paths = nu_engine::env::path_str(engine_state, stack, call.head)?;
|
||||
let cwd = engine_state.cwd(Some(stack))?;
|
||||
let editor_executable =
|
||||
crate::which(&editor_name, &paths, &cwd).ok_or(ShellError::ExternalCommand {
|
||||
let editor_executable = crate::which(&editor_name, &paths, cwd.as_ref()).ok_or(
|
||||
ShellError::ExternalCommand {
|
||||
label: format!("`{editor_name}` not found"),
|
||||
help: "Failed to find the editor executable".into(),
|
||||
span: call.head,
|
||||
})?;
|
||||
},
|
||||
)?;
|
||||
|
||||
let Some(env_path) = engine_state.get_config_path("env-path") else {
|
||||
return Err(ShellError::GenericError {
|
||||
|
@ -64,12 +64,13 @@ impl Command for ConfigNu {
|
||||
let (editor_name, editor_args) = get_editor(engine_state, stack, call.head)?;
|
||||
let paths = nu_engine::env::path_str(engine_state, stack, call.head)?;
|
||||
let cwd = engine_state.cwd(Some(stack))?;
|
||||
let editor_executable =
|
||||
crate::which(&editor_name, &paths, &cwd).ok_or(ShellError::ExternalCommand {
|
||||
let editor_executable = crate::which(&editor_name, &paths, cwd.as_ref()).ok_or(
|
||||
ShellError::ExternalCommand {
|
||||
label: format!("`{editor_name}` not found"),
|
||||
help: "Failed to find the editor executable".into(),
|
||||
span: call.head,
|
||||
})?;
|
||||
},
|
||||
)?;
|
||||
|
||||
let Some(config_path) = engine_state.get_config_path("config-path") else {
|
||||
return Err(ShellError::GenericError {
|
||||
|
Reference in New Issue
Block a user