Skip to content

Commit a56639d

Browse files
committed
fix(direnv): improve uv sync command handling
Replace hardcoded `uv sync` with configurable array-based approach that respects wrapper scripts. This ensures consistent environment activation and proper virtual environment setup regardless of uv installation method. The change addresses potential issues with direnv shell hook execution and makes the setup more robust for different development environments.
1 parent 482d2b5 commit a56639d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

template/.config/direnv/10-python.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,9 @@ if [[ -f 'pixi.lock' ]]; then
1919
fi
2020

2121
if [[ -f 'uv.lock' ]]; then
22-
uv='uv'
23-
if has uv-wrapper.sh; then uv='uv-wrapper.sh'; fi
24-
"$uv" sync
25-
sed --in-place --regexp-extended \
26-
's|\s*(include-system-site-packages)\s*=\s*.*\s*|\1 = true|' '.venv/pyvenv.cfg'
22+
uv_sync=(uv sync)
23+
if has uv-sync.sh; then uv_sync=(uv-sync.sh); fi
24+
"${uv_sync[@]}"
2725
# shellcheck disable=SC1091
2826
source '.venv/bin/activate'
2927
fi

0 commit comments

Comments
 (0)