mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
fix(venv.relocatable): script entrypoints should work if symlinked to (#8079)
Fixes: #8058 ## Test Plan Integration test (but only for Unix, because symlinks on Windows require admin privs. Plus, they are not really all that idiomatic on Windows)
This commit is contained in:
parent
f2741220e5
commit
bf15ca93cf
4 changed files with 18 additions and 6 deletions
|
@ -298,9 +298,7 @@ pub(crate) fn create(
|
|||
|
||||
let virtual_env_dir = match (relocatable, name.to_owned()) {
|
||||
(true, "activate") => {
|
||||
// Extremely verbose, but should cover all major POSIX shells,
|
||||
// as well as platforms where `readlink` does not implement `-f`.
|
||||
r#"'"$(dirname -- "$(CDPATH= cd -- "$(dirname -- "$SCRIPT_PATH")" > /dev/null && echo "$PWD")")"'"#
|
||||
r#"'"$(dirname -- "$(dirname -- "$(realpath -- "$SCRIPT_PATH")")")"'"#
|
||||
}
|
||||
(true, "activate.bat") => r"%~dp0..",
|
||||
(true, "activate.fish") => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue