Check that dygraph-combined is un-generated when testing.
authorDan Vanderkam <danvdk@gmail.com>
Tue, 21 Oct 2014 14:44:32 +0000 (10:44 -0400)
committerDan Vanderkam <danvdk@gmail.com>
Tue, 21 Oct 2014 14:44:39 +0000 (10:44 -0400)
Makefile
check-combined-unaffected.sh [new file with mode: 0755]

index 18522df..2047c7f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,7 @@ generate-gwt:
 
 test:
        @./test.sh
+       @./check-combined-unaffected.sh
 
 test-combined: move-combined test clean-combined-test
 
diff --git a/check-combined-unaffected.sh b/check-combined-unaffected.sh
new file mode 100755 (executable)
index 0000000..de1721e
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Ensures that dygraph-combined.js is unaffected.
+# Helpful for pull requests, where this is a common mistake.
+
+grep 'var' dygraph-combined.js > /dev/null
+if [ $? -eq 0 ]; then
+  echo 'Please revert changes to dygraph-combined.js' >&2
+  echo 'You can do this by running:  ' >& 2
+  echo '' >& 2
+  echo '    git checkout dygraph-combined.js' >&2
+  echo '' >& 2
+  exit 1
+fi
+
+exit 0