Refactor repocheck

master
LEdoian 2 years ago
parent 42e1c32bd6
commit 3d6dd8fa43

@ -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
if has python3; then
./test.py
else
red 'WTF no python!'
fi

Loading…
Cancel
Save