VOYU7LTAHKICIEUVW2TQVDXKDGF7LB3YQ6DF7FXVDD3TJVJTZULAC
if [ -n "$PYENV_COMMAND" ] && [ ! -x "$PYENV_COMMAND_PATH" ]; then
# Use a variable to avoid messing with the value unless we get something that works
pyenv_command_path=""
versions=($(pyenv-whence "${PYENV_COMMAND}" 2>/dev/null || true))
fallbacks=($(pyenv-fallback 2>/dev/null || true))
for fallback in "${fallbacks[@]}"; do
for version in "${versions[@]}"; do
if [ "$fallback" = "$version" ]; then
pyenv_command_path="${PYENV_ROOT}/versions/${fallback}/bin/${PYENV_COMMAND}"
break
fi
done
if [ -x "$pyenv_command_path" ]; then
PYENV_COMMAND_PATH="${pyenv_command_path}"
break
fi
done
fi
#!/usr/bin/env bash
#
# Summary: Set or show the fallback Python version(s)
#
# Usage: pyenv fallback <version> <version2> <..>
# pyenv fallback --unset
#
# Sets the fallback Python version(s). The global, local, and shell versions
# take precedence over the fallback versions, provided they have the desired command.
#
# <version> can be specified multiple times and should be a version
# tag known to pyenv. Run `pyenv versions' for a list of available Python versions.
#
set -e
[ -n "$PYENV_DEBUG" ] && set -x
# Provide pyenv completions
if [ "$1" = "--complete" ]; then
echo --unset
exec pyenv-versions --bare
fi
versions=("$@")
fallback_version_file="${PYENV_ROOT}/plugins/pyenv-fallback/version"
if [ "$versions" = "--unset" ]; then
rm -f "$fallback_version_file"
elif [ -n "$versions" ]; then
pyenv-version-file-write "$fallback_version_file" "${versions[@]}"
else
IFS=: versions=($(pyenv-version-file-read "$fallback_version_file"))
for version in "${versions[@]}"; do
echo "$version"
done
fi
# pyenv-fallback
> Give pyenv a set of always-available environments to look up commands from.
## Install
Installing **pyenv-fallback** as a pyenv plugin will give you access to the provided behavior.
```sh
$ pijul clone https://nest.pijul.com/mwchase/pyenv-fallback "$(pyenv root)/plugins/pyenv-fallback"
```
Under fish
```sh
$ pijul clone https://nest.pijul.com/mwchase/pyenv-fallback (pyenv root)/plugins/pyenv-fallback
```
## Usage
### Setting fallback environments
To specify one or more environments to use, run `pyenv fallback`, specifying one or more installed environments.
For example,
```sh
$ pyenv fallback 3.9.1 3.6.5
```
will designate 3.9.1 as the first fallback environment to check, followed by 3.6.5.
### Clearing fallback environments
To remove all fallback environments, call `pyenv fallback --unset`
### Reading fallbavk environments
To see the current list of fallback environments, call `pyenv fallback`
## License
Unless otherwise noted, all files contained within this project are liensed under the MIT opensource license. See the included file LICENSE or visit [opensource.org][] for more information.
[opensource.org]: http://opensource.org/licenses/MIT
Copyright 2021 Max Woerner Chase
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
version