aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Christopher Vogt <oss.nsp@cvogt.org>2017-06-13 20:49:23 -0400
committerGitHub <noreply@github.com>2017-06-13 20:49:23 -0400
commit7a6894fca68f97a542e698772c8bda9faa08eec1 (patch)
tree2519f8d80200ec6e03c681481971c7a670ead08b
parent81a2bcef291adb56e40ed1a0272909dab12c38b1 (diff)
parentd4cc195c794c89fbc76f9c1e5de0eb9d1083eb2b (diff)
downloadcbt-7a6894fca68f97a542e698772c8bda9faa08eec1.tar.gz
cbt-7a6894fca68f97a542e698772c8bda9faa08eec1.tar.bz2
cbt-7a6894fca68f97a542e698772c8bda9faa08eec1.zip
Merge pull request #518 from megri/master
Detect missing shellcheck and warn user during test
-rw-r--r--test/test.scala11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/test.scala b/test/test.scala
index 376d6bf..13e477f 100644
--- a/test/test.scala
+++ b/test/test.scala
@@ -35,8 +35,15 @@ object Main{
val p = pb.start
val out = new java.io.InputStreamReader(p.getInputStream)
val errors = Iterator.continually(out.read).takeWhile(_ != -1).map(_.toChar).mkString
- if( p.waitFor != 0 ){
- throw new Exception("Linting error in ./cbt bash launcher script:\n" + errors)
+ p.waitFor() match {
+ case 0 =>
+ ()
+
+ case 127 => // bash exit code: not found
+ System.err.println( "Shellcheck not found. Your build may fail during ci-build" )
+
+ case _ =>
+ throw new Exception( "Linting error in ./cbt bash launcher script:\n" + errors )
}
} else System.err.println( "Skipping shellcheck" )