feat(bin): add gotestsum-notify
This commit is contained in:
parent
1ef12a1e5f
commit
eaf2942873
1 changed files with 19 additions and 0 deletions
19
bin/.local/bin/gotestsum-notify
Executable file
19
bin/.local/bin/gotestsum-notify
Executable file
|
@ -0,0 +1,19 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
content="Tests: $TESTS_TOTAL (skipped: $TESTS_SKIPPED)"
|
||||||
|
|
||||||
|
if [[ "$TESTS_ERRORS" != "0" ]]; then
|
||||||
|
title="⚠️ TESTS ERROR"
|
||||||
|
content="$content\nErrors: $TESTS_ERRORS"
|
||||||
|
urgency=critical
|
||||||
|
elif [[ "$TESTS_FAILED" != "0" ]]; then
|
||||||
|
title="❌ TESTS FAILED"
|
||||||
|
content="$content\nErrors: $TESTS_FAILED"
|
||||||
|
urgency=critical
|
||||||
|
else
|
||||||
|
title="✅ TESTS SUCCEDED"
|
||||||
|
urgency=normal
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
notify-send --category gotestsum --urgency "$urgency" "$title" "\n$content"
|
Loading…
Add table
Reference in a new issue