Skip to content

Instantly share code, notes, and snippets.

@rubencaro
Last active August 28, 2017 07:54
Show Gist options
  • Save rubencaro/75e7b163665b47e0094a to your computer and use it in GitHub Desktop.
Save rubencaro/75e7b163665b47e0094a to your computer and use it in GitHub Desktop.
DOT auto render script
function get_mtime {
ls -l --time-style=+%s "${1?}" | cut -d' ' -f6
}
function go_render {
dotfile="$1"
mtime=0
while true;
do
newtime=$(get_mtime "$dotfile")
test $mtime -ne $newtime && dot -O -Tpng $dotfile;
mtime=$newtime
sleep 1;
done;
}
go_render myfile.dot &
@nfuste
Copy link

nfuste commented Aug 28, 2017

Mi comentario anterior lo escribió Rubén Caro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment