Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions crates/uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2489,6 +2489,29 @@ where
ContextValue::String("uv pip show".to_string()),
);
}
"activate" => {
// Handle "activate" with a helpful error message

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: The code already makes this intent pretty clear, so these two comments might be redundant. Fine to keep, but you could consider removing.

// instead of the generic unknown command error
eprintln!(
"{} `uv activate` is not supported. To activate a virtual environment, use:",
"error".red().bold()
);
#[cfg(unix)]
{
eprintln!(" {}", "source .venv/bin/activate".green());
}
#[cfg(windows)]
{
eprintln!(" {}", ".venv\\Scripts\\activate".green());
eprintln!(" {}", ".venv\\Scripts\\Activate.ps1".green());
}
eprintln!(
"\n{} Create a virtual environment with: {}",
"hint".bold().cyan(),
"uv venv".green()
);
return ExitStatus::Error.into();
}
_ => {}
}
}
Expand Down
Loading