mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 15:11:52 +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:
@ -1,5 +1,6 @@
|
||||
use nu_cmd_base::util::get_init_cwd;
|
||||
use nu_engine::command_prelude::*;
|
||||
use nu_path::AbsolutePathBuf;
|
||||
use nu_utils::filesystem::{have_permission, PermissionResult};
|
||||
|
||||
#[derive(Clone)]
|
||||
@ -43,7 +44,10 @@ impl Command for Cd {
|
||||
|
||||
// If getting PWD failed, default to the initial directory. This way, the
|
||||
// user can use `cd` to recover PWD to a good state.
|
||||
let cwd = engine_state.cwd(Some(stack)).unwrap_or(get_init_cwd());
|
||||
let cwd = engine_state
|
||||
.cwd(Some(stack))
|
||||
.map(AbsolutePathBuf::into_std_path_buf)
|
||||
.unwrap_or(get_init_cwd());
|
||||
|
||||
let path_val = {
|
||||
if let Some(path) = path_val {
|
||||
|
Reference in New Issue
Block a user