|
#!/bin/sh |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "$1" = '-h' ] || [ "$1" = '--help' ] || [ "$#" -lt 2 ]; then |
|
echo 'Usage: venv.sh [-h] <venv> <command> [<args>...]' |
|
echo |
|
echo 'Activate the Python virtual environment, and then execute the command.' |
|
echo |
|
echo 'Arguments:' |
|
echo ' <venv> The Python virtual environment directory to activate.' |
|
echo ' <command> The command to execute.' |
|
echo ' <args>... Any arguments for the command.' |
|
echo ' -h, --help Show this help message and exit.' |
|
exit 1 |
|
fi |
|
|
|
|
|
venv="$1" |
|
shift |
|
|
|
|
|
. "$venv/bin/activate" |
|
|
|
|
|
"$@" |
|
|