aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2015-07-15 19:35:27 +0200
committerDuncaen <mail@duncano.de>2015-07-15 19:35:27 +0200
commitec85a57e4a70a007900c92f3b0cfb8afa05afdcc (patch)
treef10c169f0559b9924c14d0f242c67da9b6ee56ad
parentfe3362922f27704f558391ed6132033038e04a13 (diff)
downloaddotfiles-ec85a57e4a70a007900c92f3b0cfb8afa05afdcc.tar.gz
fix and simplify venv
-rwxr-xr-xbin/venv18
1 files changed, 3 insertions, 15 deletions
diff --git a/bin/venv b/bin/venv
index f047580..1e6db04 100755
--- a/bin/venv
+++ b/bin/venv
@@ -1,28 +1,16 @@
#!/bin/mksh
-function usage {
- cat <<EOF
- Usage: $(basename $0) <path> [<cmd> <args>]
-EOF
- exit
-}
-
-[ -n "$1" ] ||
-[ -d "$1" ] || echo "venv: $1 not found" & exit 1
-
-if [ -n "$1" || ! -d "$1" ]; then
+if [ -z "$1" -o ! -d "$1" ]; then
echo "venv: <path> [<cmd> [<arg>...]]" & exit 1
fi
# virtualenv magic
unset PYTHONHOME
-export VIRTUAL_ENV="$1"
-export PATH="$1/bin:$PATH"
+export VIRTUAL_ENV=$(realpath "$1")
+export PATH="$VIRTUAL_ENV/bin:$PATH"
shift 1
-echo "$#"
-
if [ "$#" -gt "1" ]; then
"${@}"
else