From 677302dcb6573777d07790f063af8465c353a352 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Tue, 20 Sep 2022 12:50:31 +1200 Subject: [PATCH] Add watch.sh Run yarn lint on file changes and notify-send errors. This means I don't have to keep running yarn lint before every commit with Husky. --- watch.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 watch.sh diff --git a/watch.sh b/watch.sh new file mode 100755 index 0000000..e5f0536 --- /dev/null +++ b/watch.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 +)