mirror of
https://github.com/pyenv/pyenv.git
synced 2026-09-10 15:46:17 -04:00
35 lines
667 B
Bash
Executable file
35 lines
667 B
Bash
Executable file
#!/usr/bin/env bash
|
|
#
|
|
# Summary: Activate virtual environment
|
|
#
|
|
# Usage: pyenv link version <virtualenv>
|
|
#
|
|
# Link a virtual python environment to pyenvs version directory
|
|
# so that the venv can be used like one created with *pyenv-virtualenv*.
|
|
#
|
|
# <virtualenv> should be a path to a virtual python environments location.
|
|
|
|
set -e
|
|
[ -n "$PYENV_DEBUG" ] && set -x
|
|
|
|
# Provide pyenv completions
|
|
case "$1" in
|
|
--complete)
|
|
if [ -z "$2" ]; then
|
|
echo version
|
|
else
|
|
shift 2
|
|
pyenv-link-version --complete "$@"
|
|
fi
|
|
;;
|
|
version)
|
|
shift
|
|
pyenv-link-version "$@"
|
|
exit $?
|
|
;;
|
|
*)
|
|
pyenv-help --usage link >&2
|
|
exit 1
|
|
;;
|
|
esac
|