Path migration 1 (#13309)

# Description
Part 1 of replacing `std::path` types with `nu_path` types added in
#13115.
This commit is contained in:
Ian Manske
2024-07-09 09:25:23 +00:00
committed by GitHub
parent 399a7c8836
commit e98b2ceb8c
11 changed files with 51 additions and 54 deletions

View File

@ -1,3 +1,4 @@
use nu_path::AbsolutePathBuf;
use nu_protocol::{
engine::{EngineState, Stack},
Range, ShellError, Span, Value,
@ -15,6 +16,7 @@ pub fn get_init_cwd() -> PathBuf {
pub fn get_guaranteed_cwd(engine_state: &EngineState, stack: &Stack) -> PathBuf {
engine_state
.cwd(Some(stack))
.map(AbsolutePathBuf::into_std_path_buf)
.unwrap_or(crate::util::get_init_cwd())
}