entr

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 9fe171f035dcea61491fb4b35a3e4fd119bbadba
parent 06b603b9dbb1ea8b3f36217b45acd1fbf4a50a3b
Author: Michael Constantine Dimopoulos <31562759+MichaelDim02@users.noreply.github.com>
Date:   Mon, 13 Jun 2022 05:32:01 +0000

Add files via upload
Diffstat:
Aentr | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/entr b/entr @@ -0,0 +1,25 @@ +#!/bin/sh + +if [ "$#" -eq 0 ]; then + echo "$0: no arguments given" >&2 + exit 1 +fi + +trigger_file=`cat` +if ! [ -f "$trigger_file" ]; then + echo "$trigger_file: file doesn't exist" >&2 + exit 1 +fi + +"$@" +oldhash=$(cat "$trigger_file" | md5sum) +for (( ; ; )) +do + newhash=$(cat "$trigger_file" | md5sum) + if [ "$newhash" != "$oldhash" ]; then + newhash=$(cat "$trigger_file" | md5sum) + oldhash=$newhash + "$@" + fi + sleep .5 +done