From 565df842c90c22b7143fbe34167f8688fe7d47f2 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Tue, 20 Sep 2022 13:51:34 +1200 Subject: [PATCH] Add watch-lint.sh and watch-tsc.sh Both these scripts will live reload run yarn lint and tsc, reporting errors with notify-send. --- watch-lint.sh | 9 +++++++++ watch-tsc.sh | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100755 watch-lint.sh create mode 100755 watch-tsc.sh diff --git a/watch-lint.sh b/watch-lint.sh new file mode 100755 index 0000000..e5f0536 --- /dev/null +++ b/watch-lint.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +ls *.ts* | entr yarn lint | tee >( + while read ln; do + if echo "${ln}" | grep -q "error"; then + notify-send "${ln}" + fi + done +) diff --git a/watch-tsc.sh b/watch-tsc.sh new file mode 100755 index 0000000..092687e --- /dev/null +++ b/watch-tsc.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +yarn tsc --watch --preserveWatchOutput | tee >( + while read ln; do + if echo "${ln}" | grep -q "Found [^0][0-9]* error"; then + notify-send "${ln}" + fi + done +)