Optionalize size check opt-size-check
authorDan Vanderkam <danvdk@gmail.com>
Mon, 16 Nov 2015 20:40:34 +0000 (15:40 -0500)
committerDan Vanderkam <danvdk@gmail.com>
Mon, 16 Nov 2015 20:40:34 +0000 (15:40 -0500)
scripts/weigh-in.sh

index e58f786..b46f8c8 100755 (executable)
@@ -3,7 +3,15 @@
 # See https://github.com/danvk/travis-weigh-in
 set -o errexit
 
-curl -O https://raw.githubusercontent.com/danvk/travis-weigh-in/master/weigh_in.py
-python weigh_in.py dist/dygraph-combined.js
-gzip -c dist/dygraph.min.js > dist/dygraph.min.js.gz
-python weigh_in.py dist/dygraph.min.js.gz
+if [ -z "$GITHUB_TOKEN" ]; then
+    echo "GITHUB_TOKEN not set. Skipping size checks."
+    exit 0
+
+else
+
+  curl -O https://raw.githubusercontent.com/danvk/travis-weigh-in/master/weigh_in.py
+  python weigh_in.py dist/dygraph-combined.js
+  gzip -c dist/dygraph.min.js > dist/dygraph.min.js.gz
+  python weigh_in.py dist/dygraph.min.js.gz
+
+fi