| @ -1,13 +1,14 @@ | |||
| #!/bin/sh | |||
| #!/bin/bash | |||
| set -e | |||
| # Scripts path | |||
| SCRIPT_PATH="$( dirname -- "$( readlink -f -- "${0}"; )"; )/script" | |||
| # Activate OctoDNS Python venv | |||
| source "${SCRIPT_PATH}/common.sh" | |||
| HOOKS=$(dirname "$0") | |||
| GIT=$(dirname "$HOOKS") | |||
| ROOT=$(dirname "$GIT") | |||
| . "$ROOT/env/bin/activate" | |||
| "$ROOT/script/changelog" check | |||
| "$ROOT/script/lint" | |||
| "$ROOT/script/format" --check --quiet || (echo "Formatting check failed, run ./script/format" && exit 1) | |||
| "$ROOT/script/coverage" | |||
| ./script/changelog check | |||
| ./script/lint | |||
| ./script/format --check --quiet || ( | |||
| echo "Formatting check failed, run ./script/format" && | |||
| exit 1 | |||
| ) | |||
| ./script/coverage | |||
| @ -1,16 +1,8 @@ | |||
| #!/bin/sh | |||
| set -e | |||
| #!/bin/bash | |||
| cd "$(dirname "$0")/.." | |||
| ROOT=$(pwd) | |||
| if [ -z "$VENV_NAME" ]; then | |||
| VENV_NAME="env" | |||
| fi | |||
| ACTIVATE="$VENV_NAME/bin/activate" | |||
| if [ -f "$ACTIVATE" ]; then | |||
| . "$ACTIVATE" | |||
| fi | |||
| # Get current script path | |||
| SCRIPT_PATH="$( dirname -- "$( readlink -f -- "${0}"; )"; )" | |||
| # Activate OctoDNS Python venv | |||
| source "${SCRIPT_PATH}/common.sh" | |||
| changelet "$@" | |||
| @ -0,0 +1,27 @@ | |||
| # This script contains Python's venv management features common to all shell | |||
| # scripts located in this directory and to the repository pre-commit hook. | |||
| # This script is *not* meant to be run directly. | |||
| # Exit on any error | |||
| set -e | |||
| # Path to OctoDNS base directory | |||
| OCTODNS_PATH="$( dirname -- "${SCRIPT_PATH}"; )" | |||
| # Change to path OctoDNS base directory | |||
| cd "$( dirname -- "${SCRIPT_PATH}"; )" | |||
| # If no venv name is set, set it to "env" | |||
| if [ -z "${VENV_NAME}" ]; then | |||
| VENV_NAME="${OCTODNS_PATH}/env" | |||
| fi | |||
| ACTIVATE="${VENV_NAME}/bin/activate" | |||
| # Check that [venv_directory]/bin/activate exists. | |||
| if [ ! -f "${ACTIVATE}" ]; then | |||
| echo "${ACTIVATE} does not exist. Run ./script/bootstrap" >&2 | |||
| exit 1 | |||
| fi | |||
| # Activate OctoDNS venv. | |||
| source "${ACTIVATE}" | |||
| @ -1,10 +1,11 @@ | |||
| #!/bin/bash | |||
| set -e | |||
| # Get current script path | |||
| SCRIPT_PATH="$( dirname -- "$( readlink -f -- "${0}"; )"; )" | |||
| # Activate OctoDNS Python venv | |||
| source "${SCRIPT_PATH}/common.sh" | |||
| SOURCES="$(find *.py octodns tests docs -name '*.py') $(grep --files-with-matches '^#!.*python' script/*)" | |||
| . env/bin/activate | |||
| isort "$@" $SOURCES | |||
| black "$@" $SOURCES | |||
| @ -1,19 +1,9 @@ | |||
| #!/bin/sh | |||
| set -e | |||
| #!/bin/bash | |||
| cd "$(dirname "$0")/.." | |||
| ROOT=$(pwd) | |||
| if [ -z "$VENV_NAME" ]; then | |||
| VENV_NAME="env" | |||
| fi | |||
| ACTIVATE="$VENV_NAME/bin/activate" | |||
| if [ ! -f "$ACTIVATE" ]; then | |||
| echo "$ACTIVATE does not exist, run ./script/bootstrap" >&2 | |||
| exit 1 | |||
| fi | |||
| . "$ACTIVATE" | |||
| # Get current script path | |||
| SCRIPT_PATH="$( dirname -- "$( readlink -f -- "${0}"; )"; )" | |||
| # Activate OctoDNS Python venv | |||
| source "${SCRIPT_PATH}/common.sh" | |||
| SOURCES="$(find *.py octodns tests docs -name '*.py') $(grep --files-with-matches '^#!.*python' script/*)" | |||