Permalink
Browse files

Add prepublish script

  • Loading branch information...
laktek committed Sep 29, 2012
1 parent 1564529 commit 8bf851f44a31b3fba43965e0d74babcc42e40a4f
Showing with 27 additions and 0 deletions.
  1. +27 −0 misc/prepublish.sh
View
@@ -0,0 +1,27 @@
+#!/bin/sh
+exitstatus=0
+/bin/echo "Running the test suite..."
+
+jasmine-node spec;
+
+if [ $? == 0 ]
+then
+ /bin/echo "Running JSHint..."
+ jshint lib/*;
+ exitstatus=$?
+else
+ exitstatus=$?
+fi
+
+if [ $exitstatus != 0 ]
+then
+ /bin/echo -n "It seems there are failing tests or code style issues. Ignore them and continue with publishing? (y/n): "
+ read answer
+ if [ "$answer" == "y" ]
+ then
+ exit 0
+ else
+ /bin/echo "Canceling package publishing..."
+ exit 1
+ fi
+fi

0 comments on commit 8bf851f

Please sign in to comment.