From 6c499869a1abe3111f75ca5f0777248c751c143f Mon Sep 17 00:00:00 2001 From: j178 <10510431+j178@users.noreply.github.com> Date: Sat, 20 Jul 2024 21:58:14 +0800 Subject: [PATCH] Absolutize path --- crates/uv/src/commands/project/init.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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.