autobuild challenge-bot.html and reload in browser
authordaniel watson <ozzloy@gmail.com>
Sat, 11 Jun 2016 04:36:19 +0000 (21:36 -0700)
committerdaniel watson <ozzloy@gmail.com>
Sat, 11 Jun 2016 05:00:26 +0000 (22:00 -0700)
curriculum/autobuild.bash [new file with mode: 0755]
curriculum/makefile

diff --git a/curriculum/autobuild.bash b/curriculum/autobuild.bash
new file mode 100755 (executable)
index 0000000..d5355ab
--- /dev/null
@@ -0,0 +1,40 @@
+#! /usr/bin/env bash
+# tldr; AGPLv3+
+# copyright info at bottom
+
+# build directory when any file is modified
+inotifywait \
+  --quiet \
+  --recursive \
+  --monitor \
+  --event close_write \
+  --format %f \
+  . | \
+  while IFS= read -r file; do
+    make
+  done
+
+# goes great with
+# https://addons.mozilla.org/en-US/firefox/addon/auto-reload/
+#  url regex:
+#   challenge-bot\.html
+#  local files
+#   $CWD/challenge-bot.html
+
+# Copyright 2016 daniel watson
+
+# This file is part of challenge-bot.
+
+# challenge-bot is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+
+# challenge-bot is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Affero General Public License for more details.
+
+# You should have received a copy of the GNU Affero General Public
+# License along with challenge-bot.  If not, see
+# <http://www.gnu.org/licenses/>.
index b63ddcfd0189fbaa66a83e25a95a6dd4abe38f3f..8ef3a0fb402aaf807efaf5cd6476e31c2ead6299 100644 (file)
@@ -1,5 +1,9 @@
 all:challenge-bot.html
 
+.PHONY: autobuild
+autobuild:
+       ./autobuild.bash
+
 square.png: square.scad makefile
        @openscad \
          --render \