Refactor shell script syntax and consistency

- Add a missing space for styling
- Replace legacy "\`...\`" with `$(...)`
- Quote variable to prevent word splitting
- Use builtin `command -v` instead of non-standard `which`
- Add two missing `>&2` redirection for error/warning message
This commit is contained in:
Peter Dave Hello
2019-04-13 22:04:04 +08:00
parent a0bd756c09
commit a516f2ca7c
4 changed files with 13 additions and 13 deletions
+3 -3
View File
@@ -4,7 +4,7 @@
set -e
cd "$(dirname $0)"/..
cd "$(dirname "$0")"/..
ROOT=$(pwd)
if [ -z "$VENV_NAME" ]; then
@@ -13,9 +13,9 @@ fi
if [ ! -d "$VENV_NAME" ]; then
if [ -z "$VENV_PYTHON" ]; then
VENV_PYTHON=`which python`
VENV_PYTHON=$(command -v python)
fi
virtualenv --python=$VENV_PYTHON $VENV_NAME
virtualenv --python="$VENV_PYTHON" "$VENV_NAME"
fi
. "$VENV_NAME/bin/activate"