aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-02-13 01:16:14 +0100
committerDuncaen <mail@duncano.de>2017-02-13 01:16:14 +0100
commit0a2160b031229dabae3e278f6b13fff3e977b22f (patch)
tree6305b963f2f38ea4be505acd35c399988f9ecd79
parent61fe557f4c1b9d8c51efba12e342496c4148a5ae (diff)
downloaddotfiles-0a2160b031229dabae3e278f6b13fff3e977b22f.tar.gz
bin/venv: simplify
-rwxr-xr-xbin/venv15
1 files changed, 5 insertions, 10 deletions
diff --git a/bin/venv b/bin/venv
index afeca92..b01182a 100755
--- a/bin/venv
+++ b/bin/venv
@@ -1,16 +1,11 @@
-#!/bin/mksh
+#!/bin/sh
+# venv - small POSIX shell script for python virtualenv
[ -z "$1" -o ! -d "$1" ] && echo "venv: <path> [<cmd> [<arg>...]]" && exit 1
# virtualenv magic
unset PYTHONHOME
-export VIRTUAL_ENV=$(realpath "$1")
-export PATH="$VIRTUAL_ENV/bin:$PATH"
+export VIRTUAL_ENV=$(realpath "$1") PATH="$VIRTUAL_ENV/bin:$PATH"
-shift 1
-
-if [ "$#" -gt "1" ]; then
- "${@}"
-else
- $(command -v mksh)
-fi
+shift
+[ "$#" -gt "1" ] && "${@}" || "${SHELL:-/bin/sh}"