diff --git a/drydocker/roundcubemail-plugins-kolab/test_jslint.sh b/drydocker/roundcubemail-plugins-kolab/test_jslint.sh new file mode 100755 --- /dev/null +++ b/drydocker/roundcubemail-plugins-kolab/test_jslint.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +pushd /srv/${PACKAGE}.git + +wget http://dl.google.com/closure-compiler/compiler-latest.zip -O compiler.zip || (echo "Failed to download the closure-compiler" ; exit 1) +unzip -u compiler.zip + +retval=0 + +find ./plugins -type f -name "*.js" | grep -v '.min' | grep -v 'viewer/' | sort | while read file; do + echo "Linting '$file' ..." + java -jar ./compiler.jar --language_in="ECMASCRIPT3" $file > /dev/null + rval=$? + if [ ${rval} -ne 0 ]; then + echo "> FAILED" + else + echo "> OK" + fi + retval=$(( ${retval} + $rval )) +done + +rm -f ./compiler.jar ./compiler.zip ./README* ./COPYING + +if [ ${retval} -ne 0 ]; then + echo "FAILED jslint test." + exit 1 +fi + +popd