Skip to content

Commit f7741fa

Browse files
authored
Merge pull request GoogleCloudPlatform#273 from GoogleCloudPlatform/tswast-shellcheck
Add shellcheck to Travis tests and fix existing shell lint errors.
2 parents 60deba5 + a7d7fd4 commit f7741fa

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ jdk:
1717
- oraclejdk8
1818
addons:
1919
apt:
20+
sources:
21+
# Grab shellcheck from the Debian repo.
22+
# https://github.com/koalaman/shellcheck/wiki/TravisCI
23+
- debian-sid
2024
packages:
2125
- expect
26+
- shellcheck
2227
before_install:
2328
- openssl aes-256-cbc -K $encrypted_d17a6ce39290_key -iv $encrypted_d17a6ce39290_iv
2429
-in gae-firebase-secrets.json.enc -out appengine/firebase-event-proxy/gae-firebase-event-proxy/src/main/webapp/gae-firebase-secrets.json

speech/grpc/bin/speech-sample-async.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# limitations under the License.
1515

1616
SRC_DIR=$(cd "$(dirname "$0")/.."; pwd)
17-
java -cp ${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar \
17+
java -cp "${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar" \
1818
com.examples.cloud.speech.AsyncRecognizeClient "$@"

speech/grpc/bin/speech-sample-streaming.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# limitations under the License.
1515

1616
SRC_DIR=$(cd "$(dirname "$0")/.."; pwd)
17-
java -cp ${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar \
17+
java -cp "${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar" \
1818
com.examples.cloud.speech.StreamingRecognizeClient "$@"

speech/grpc/bin/speech-sample-sync.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
# limitations under the License.
1515

1616
SRC_DIR=$(cd "$(dirname "$0")/.."; pwd)
17-
java -cp ${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar \
17+
java -cp "${SRC_DIR}/target/grpc-sample-1.0-jar-with-dependencies.jar" \
1818
com.examples.cloud.speech.SyncRecognizeClient "$@"

travis.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ set -e
1717
set -x
1818
# Set pipefail so that `egrep` does not eat the exit code.
1919
set -o pipefail
20+
shopt -s globstar
2021

2122
SKIP_TESTS=false
22-
if [ -z "$GOOGLE_APPLICATION_CREDENTIALS"]; then
23+
if [ -z "$GOOGLE_APPLICATION_CREDENTIALS" ] ; then
2324
SKIP_TESTS=true
2425
fi
2526
mvn --batch-mode clean verify -DskipTests=$SKIP_TESTS | egrep -v "(^\[INFO\] Download|^\[INFO\].*skipping)"
@@ -32,7 +33,10 @@ devserver_tests=(
3233
appengine/datastore/indexes-exploding
3334
appengine/datastore/indexes-perfect
3435
)
35-
for testdir in ${devserver_tests[@]} ; do
36+
for testdir in "${devserver_tests[@]}" ; do
3637
./java-repo-tools/scripts/test-localhost.sh appengine "${testdir}"
3738
done
3839

40+
# Check that all shell scripts in this repo (including this one) pass the
41+
# Shell Check linter.
42+
shellcheck ./**/*.sh

0 commit comments

Comments
 (0)