Skip to content

Commit

Permalink
Improve error message for uv init already init-ed (#7198)
Browse files Browse the repository at this point in the history
Someone in
https://discord.com/channels/1039017663004942429/1207998321562619954/1282411049106145400
found this confusing

Could maybe improve further, e.g. what the user should do next might
depend if there are [project] or [tool.uv] sections

---------

Co-authored-by: Charlie Marsh <crmarsh416@gmail.com>
  • Loading branch information
hauntsaninja and charliermarsh authored Sep 8, 2024
1 parent bf33a7c commit 022e413
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/uv/src/commands/project/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub(crate) async fn init(
if path.join("pyproject.toml").exists() {
let path = std::path::absolute(&path).unwrap_or_else(|_| path.simplified().to_path_buf());
anyhow::bail!(
"Project is already initialized in `{}`",
"Project is already initialized in `{}` (`pyproject.toml` file exists)",
path.display().cyan()
);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ fn init_normalized_names() -> Result<()> {
----- stdout -----
----- stderr -----
error: Project is already initialized in `[TEMP_DIR]/foo-bar`
error: Project is already initialized in `[TEMP_DIR]/foo-bar` (`pyproject.toml` file exists)
"###);

let child = context.temp_dir.child("foo-bar");
Expand Down

0 comments on commit 022e413

Please sign in to comment.