dotfiles/.local/bin/scripts/retest

14 lines
361 B
Plaintext
Raw Normal View History

#!/bin/sh
2023-11-04 18:08:39 +00:00
# Execute a gradle task (by default "test") until it fails
code=0
case "$1" in ([0-9]*) code=$1; shift;; esac
task="${1:-test}"
test $# -gt 1 && prefix=":$2:"
gradle=$(test -x "./gradlew"; expr gradle \& $? \| ./gradlew)
( exit $code )
while test $? -eq $code
do $gradle ${prefix}clean$(echo $task | sed -e 's/^./\U&/') ${prefix}$task "${@:3}"
done