diff --git a/repocheck.sh b/repocheck.sh index 491a31b..e2ded90 100755 --- a/repocheck.sh +++ b/repocheck.sh @@ -14,25 +14,32 @@ set -e +has() { + what="$1" + type "$what" >/dev/null 2>&1 && return 0 || return 1 +} + red() { - tput setaf 1 + has tput && tput setaf 1 || true # We are OK with dumb terminals echo "$@" - tput sgr0 + has tput && tput sgr0 || true } -has_reuse=$(type reuse >/dev/null 2>&1 && echo true || echo false) -if $has_reuse; then +if has reuse; then reuse lint else red "REUSE tool not found, skipping" fi -has_mypy=$(type mypy >/dev/null 2>&1 && echo true || echo false) -if $has_mypy; then +if has mypy; then mypy *.py else red "Mypy not found, skipping" fi -./test.py +if has python3; then + ./test.py +else + red 'WTF no python!' +fi