Fix "unbound variable" error in fmt.sh (#933)

Seems like an array that is only declared but never assigned to cannot
be dereferenced with `arr[@]` under `set -u`. We can easily work around
this by using an empty string as default value like `:-`.
This commit is contained in:
Gerolf Seitz 2019-05-06 12:06:41 +02:00 committed by GitHub
parent c3a8a4d02a
commit ec0bba2488
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
fmt.sh
View File

@ -81,7 +81,7 @@ done
trap - EXIT
# check for scala code style
run ./scalafmt.sh "${scalafmt_args[@]}"
run ./scalafmt.sh "${scalafmt_args[@]:-}"
# check for Bazel build files code formatting
run bazel run "$buildifier_target"