diff --git a/script/bootstrap b/script/bootstrap index 7a82923..b9ba803 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -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" diff --git a/script/coverage b/script/coverage index d38a41a..8552eba 100755 --- a/script/coverage +++ b/script/coverage @@ -26,11 +26,11 @@ export DYN_PASSWORD= export DYN_USERNAME= export GOOGLE_APPLICATION_CREDENTIALS= -coverage run --branch --source=octodns --omit=octodns/cmds/* `which nosetests` --with-xunit "$@" +coverage run --branch --source=octodns --omit=octodns/cmds/* "$(command -v nosetests)" --with-xunit "$@" coverage html coverage xml coverage report -coverage report | grep ^TOTAL| grep -qv 100% && { - echo "Incomplete code coverage" +coverage report | grep ^TOTAL | grep -qv 100% && { + echo "Incomplete code coverage" >&2 exit 1 } || echo "Code coverage 100%" diff --git a/script/release b/script/release index 3b64911..dd3e1b1 100755 --- a/script/release +++ b/script/release @@ -2,7 +2,7 @@ set -e -cd "$(dirname $0)"/.. +cd "$(dirname "$0")"/.. ROOT=$(pwd) if [ -z "$VENV_NAME" ]; then @@ -16,10 +16,10 @@ if [ ! -f "$ACTIVATE" ]; then fi . "$ACTIVATE" -VERSION=$(grep __VERSION__ $ROOT/octodns/__init__.py | sed -e "s/.* = '//" -e "s/'$//") +VERSION="$(grep __VERSION__ "$ROOT/octodns/__init__.py" | sed -e "s/.* = '//" -e "s/'$//")" -git tag -s v$VERSION -m "Release $VERSION" -git push origin v$VERSION +git tag -s "v$VERSION" -m "Release $VERSION" +git push origin "v$VERSION" echo "Tagged and pushed v$VERSION" python setup.py sdist twine upload dist/*$VERSION.tar.gz diff --git a/script/sdist b/script/sdist index f244363..1ab0949 100755 --- a/script/sdist +++ b/script/sdist @@ -3,13 +3,13 @@ set -e if ! git diff-index --quiet HEAD --; then - echo "Changes in local directory, commit or clear" + echo "Changes in local directory, commit or clear" >&2 exit 1 fi SHA=$(git rev-parse HEAD) python setup.py sdist -TARBALL=dist/octodns-$SHA.tar.gz -mv dist/octodns-0.*.tar.gz $TARBALL +TARBALL="dist/octodns-$SHA.tar.gz" +mv dist/octodns-0.*.tar.gz "$TARBALL" echo "Created $TARBALL"