Skip to content
This repository was archived by the owner on Feb 4, 2023. It is now read-only.

Commit e6cb9a3

Browse files
committed
travis.yml: check bash script with shellcheck (only errors)
1 parent 9ffe571 commit e6cb9a3

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

.travis.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,23 @@ matrix:
1818
osx_image: xcode9.3
1919

2020

21+
install:
22+
- brew install shellcheck
23+
24+
25+
before_script:
26+
- sw_vers
27+
- shellcheck -V
28+
29+
2130
# run the 'java-version-tester' script and show&save (`tee`) the output to a
2231
# logfile; then grep the logfile for 'FAILED' entries which would cause grep
2332
# to exit with 0; then run 'test' command and swap the grep exit code
2433
# to return with 0 if grep doesn't match and return with 1 if it matches
2534
script:
26-
- sw_vers
2735
- bash test/java-version-tester.sh | tee test/java-version-tester.log
2836
- cat test/java-version-tester.log | grep FAILED ; test $? -eq 1
37+
# test with shellcheck for bash syntax errors which should fail the build
38+
# grep for errors until shellcheck issue / feature request
39+
# https://github.com/koalaman/shellcheck/issues/524 is implemented
40+
- shellcheck -s bash -f gcc src/universalJavaApplicationStub | grep "error:" ; test $? -eq 1

0 commit comments

Comments
 (0)