nu_engine::env

Function current_dir_str

Source
pub fn current_dir_str(
    engine_state: &EngineState,
    stack: &Stack,
) -> Result<String, ShellError>
👎Deprecated since 0.92.3: please use EngineState::cwd() instead
Expand description

Returns the current working directory as a String, which is guaranteed to be canonicalized. Unlike current_dir_str_const(), this also considers modifications to the current working directory made on the stack.

Returns an error if $env.PWD doesn’t exist, is not a String, or is not an absolute path.