mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-11 04:53:53 -05:00
add install.sh
This commit is contained in:
18
README.md
18
README.md
@@ -21,6 +21,24 @@ the `~/.pyenv/plugins/python-virtualenv` directory. From that directory, you
|
||||
can check out a specific release tag. To update python-virtualenv, run `git
|
||||
pull` to download the latest changes.
|
||||
|
||||
### Installing as a standalone program (advanced)
|
||||
|
||||
Installing python-virtualenv as a standalone program will give you access to
|
||||
the `python-virtualenv` command for precise control over Python version
|
||||
installation. If you have rbenv installed, you will also be able to
|
||||
use the `rbenv install` command.
|
||||
|
||||
$ git clone git://github.com/yyuu/python-virtualenv.git
|
||||
$ cd python-virtualenv
|
||||
$ ./install.sh
|
||||
|
||||
This will install python-virtualenv into `/usr/local`. If you do not have
|
||||
write permission to `/usr/local`, you will need to run `sudo
|
||||
./install.sh` instead. You can install to a different prefix by
|
||||
setting the `PREFIX` environment variable.
|
||||
|
||||
To update python-virtualenv after it has been installed, run `git pull` in
|
||||
your cloned copy of the repository, then re-run the install script.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -115,7 +115,9 @@ fi
|
||||
VIRTUALENV_PYTHON_BIN="${VIRTUALENV_PATH}/bin/python"
|
||||
|
||||
# create virtualenv
|
||||
"${PYTHON_BIN}" "${PYTHON_VIRTUALENV_ROOT}/libexec/virtualenv.py" "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}"
|
||||
VIRTUALENV="${PYTHON_VIRTUALENV_ROOT}/libexec/python-virtualenv/virtualenv.py"
|
||||
[ -f "${VIRTUALENV}" ] || VIRTUALENV="${PYTHON_VIRTUALENV_ROOT}/libexec/virtualenv.py"
|
||||
"${PYTHON_BIN}" "${VIRTUALENV}" "${VIRTUALENV_OPTIONS[@]}" "${VIRTUALENV_PATH}"
|
||||
|
||||
# create symlink of `python' bound for actual executable
|
||||
if [ ! -f "$VIRTUALENV_PYTHON_BIN" ]; then
|
||||
|
||||
23
install.sh
Executable file
23
install.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "${PREFIX}" ]; then
|
||||
PREFIX="/usr/local"
|
||||
fi
|
||||
|
||||
BIN_PATH="${PREFIX}/bin"
|
||||
LIBEXEC_PATH="${PREFIX}/libexec/python-virtualenv"
|
||||
|
||||
mkdir -p "${BIN_PATH}"
|
||||
mkdir -p "${LIBEXEC_PATH}"
|
||||
|
||||
for file in bin/*; do
|
||||
cp "${file}" "${BIN_PATH}"
|
||||
done
|
||||
|
||||
for file in libexec/*; do
|
||||
cp "${file}" "${LIBEXEC_PATH}"
|
||||
done
|
||||
|
||||
echo "Installed python-virtualenv at ${PREFIX}"
|
||||
Reference in New Issue
Block a user