Skip to content

Instantly share code, notes, and snippets.

@raghavkarol
Created January 15, 2019 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raghavkarol/c47d9e7b300203a5840cb0e3280a3855 to your computer and use it in GitHub Desktop.
Save raghavkarol/c47d9e7b300203a5840cb0e3280a3855 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
readonly dot_file="$1"
readonly output_file="$2"
readonly dot_file_abs=$(readlink -f $dot_file)
if [ ! -f $dot_file_abs ]
then
echo "$dot_file is not a file"
exit 1
fi
echo "$(date) start watch compile reload for $dot_file"
watchmedo shell-command \
--patterns '*.dot' \
--command \
"echo \$(date) compiling \${watch_src_path}; dot2html_with_svg $dot_file $output_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment