diff --git a/crates/uv/src/commands/project/init.rs b/crates/uv/src/commands/project/init.rs index 00dfbb1c751e..810207d53dff 100644 --- a/crates/uv/src/commands/project/init.rs +++ b/crates/uv/src/commands/project/init.rs @@ -1,5 +1,5 @@ use std::fmt::Write; -use std::path::PathBuf; +use std::path::Path; use anyhow::Result; use owo_colors::OwoColorize; @@ -28,7 +28,7 @@ pub(crate) async fn init( } // Discover the current workspace, if it exists. - let current_dir = std::env::current_dir()?.canonicalize()?; + let current_dir = std::env::current_dir()?.simple_canonicalize()?; let workspace = match ProjectWorkspace::discover(¤t_dir, None).await { Ok(project) => Some(project), Err(WorkspaceError::MissingPyprojectToml) => None, @@ -38,7 +38,7 @@ pub(crate) async fn init( // Default to the current directory if a path was not provided. let path = match explicit_path { None => current_dir.clone(), - Some(ref path) => PathBuf::from(path), + Some(ref path) => uv_fs::absolutize_path(Path::new(path))?.to_path_buf(), }; // Default to the directory name if a name was not provided.