diff --git a/crates/uv-fs/src/path.rs b/crates/uv-fs/src/path.rs index 7ce2ef42a..0e162c76c 100644 --- a/crates/uv-fs/src/path.rs +++ b/crates/uv-fs/src/path.rs @@ -6,8 +6,13 @@ use either::Either; use path_slash::PathExt; /// The current working directory. -pub static CWD: LazyLock = - LazyLock::new(|| std::env::current_dir().expect("The current directory must exist")); +#[allow(clippy::exit, clippy::print_stderr)] +pub static CWD: LazyLock = LazyLock::new(|| { + std::env::current_dir().unwrap_or_else(|_e| { + eprintln!("Current directory does not exist"); + std::process::exit(1); + }) +}); pub trait Simplified { /// Simplify a [`Path`].