2 Commits

Author SHA1 Message Date
k
a54ddef566 Merge 5d7894d189 into e8c8fd9b84 2024-12-11 22:14:30 -08:00
K Kollmann
5d7894d189 fix: PATH update for non-fish shells
Checks PATH variable for existing inclusion of shims
for shells other than fish.

See PR #430
2024-01-20 20:10:27 +01:00
5 changed files with 15 additions and 16 deletions

View File

@@ -6,9 +6,8 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: os:
- ubuntu-24.04
- ubuntu-22.04 - ubuntu-22.04
- macos-15 - ubuntu-20.04
- macos-14 - macos-14
- macos-13 - macos-13
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}

View File

@@ -1,4 +1,4 @@
Copyright (c) 2025 Yamashita, Yuu Copyright (c) 2015 Yamashita, Yuu
Permission is hereby granted, free of charge, to any person obtaining Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the a copy of this software and associated documentation files (the

View File

@@ -28,12 +28,6 @@ From inside that directory you can:
- Get the latest development release by running `git pull` to download the - Get the latest development release by running `git pull` to download the
latest changes. latest changes.
💡 **WSL note:** If you're using WSL, we recommend setting Git to use Unix-style line endings to prevent script execution errors:
```sh
git config --global core.autocrlf input
```
1. **Check out pyenv-virtualenv into plugin directory** 1. **Check out pyenv-virtualenv into plugin directory**
```bash ```bash
@@ -88,7 +82,7 @@ brew install --HEAD pyenv-virtualenv
``` ```
After installation, you'll still need to do After installation, you'll still need to do
[Pyenv shell setup steps](https://github.com/pyenv/pyenv#b-set-up-your-shell-environment-for-pyenv) [Pyenv shell setup steps](https://github.com/pyenv/pyenv#basic-github-checkout)
then add then add
```sh ```sh
eval "$(pyenv virtualenv-init -)" eval "$(pyenv virtualenv-init -)"

View File

@@ -95,8 +95,10 @@ EOS
;; ;;
* ) * )
cat <<EOS cat <<EOS
export PATH="${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims:\${PATH}"; if [[ ":$PATH:" != *"${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims"* ]]; then
export PYENV_VIRTUALENV_INIT=1; export PATH="${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims:\${PATH}";
export PYENV_VIRTUALENV_INIT=1;
fi
EOS EOS
;; ;;
esac esac

View File

@@ -50,8 +50,10 @@ load test_helper
run pyenv-virtualenv-init - bash run pyenv-virtualenv-init - bash
assert_success assert_success
assert_output <<EOS assert_output <<EOS
export PATH="${TMP}/pyenv/plugins/pyenv-virtualenv/shims:\${PATH}"; if [[ ":$PATH:" != *"${TMP}/pyenv/plugins/pyenv-virtualenv/shims"* ]]; then
export PYENV_VIRTUALENV_INIT=1; export PATH="${TMP}/pyenv/plugins/pyenv-virtualenv/shims:\${PATH}";
export PYENV_VIRTUALENV_INIT=1;
fi
_pyenv_virtualenv_hook() { _pyenv_virtualenv_hook() {
local ret=\$? local ret=\$?
if [ -n "\${VIRTUAL_ENV-}" ]; then if [ -n "\${VIRTUAL_ENV-}" ]; then
@@ -93,8 +95,10 @@ EOS
run pyenv-virtualenv-init - zsh run pyenv-virtualenv-init - zsh
assert_success assert_success
assert_output <<EOS assert_output <<EOS
export PATH="${TMP}/pyenv/plugins/pyenv-virtualenv/shims:\${PATH}"; if [[ ":$PATH:" != *"${TMP}/pyenv/plugins/pyenv-virtualenv/shims"* ]]; then
export PYENV_VIRTUALENV_INIT=1; export PATH="${TMP}/pyenv/plugins/pyenv-virtualenv/shims:\${PATH}";
export PYENV_VIRTUALENV_INIT=1;
fi
_pyenv_virtualenv_hook() { _pyenv_virtualenv_hook() {
local ret=\$? local ret=\$?
if [ -n "\${VIRTUAL_ENV-}" ]; then if [ -n "\${VIRTUAL_ENV-}" ]; then