aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar Androbin <robin.richtsfeld@gmail.com>2017-12-14 07:24:27 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-12-14 07:25:56 -0800
commitef381e54b124a7bb71dcb883fdc999f3bd37d4ed (patch)
tree47f8f0e98ccfb24460b7b1d389670838eb08620b /scripts
parent1b66574799a242b09f88a1b0cfe47a956f17fa87 (diff)
Shell code cleanup
- Argument mixes string and array. Use * or separate argument. - Quote the grep pattern so the shell won't interpret it. - Use "${var:?}" to ensure this never expands to /* . - > is for string comparisons. Use -gt instead. - Quote the parameter to -name so the shell won't interpret it. Closes #4163. PiperOrigin-RevId: 179042046
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bootstrap/buildenv.sh2
-rwxr-xr-xscripts/bootstrap/compile.sh6
-rwxr-xr-xscripts/serve-docs.sh2
3 files changed, 5 insertions, 5 deletions
diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh
index 5c5061b45d..8dfb6fe917 100755
--- a/scripts/bootstrap/buildenv.sh
+++ b/scripts/bootstrap/buildenv.sh
@@ -38,7 +38,7 @@ function fail() {
exitCode=1
fi
echo >&2
- echo "ERROR: $@" >&2
+ echo "ERROR: $*" >&2
exit $exitCode
}
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index e817b1908e..c7b26ccc72 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -17,11 +17,11 @@
# Script for building bazel from scratch without bazel
PROTO_FILES=$(ls src/main/protobuf/*.proto src/main/java/com/google/devtools/build/lib/buildeventstream/proto/*.proto)
-LIBRARY_JARS=$(find third_party -name '*.jar' | grep -Fv /javac-9-dev-r3297-4.jar | grep -Fv /javac-9-dev-4023-3.jar | grep -Fv /javac7.jar | grep -Fv JavaBuilder | grep -Fv third_party/guava | grep -Fv third_party/guava | grep -ve third_party/grpc/grpc.*jar | tr "\n" " ")
+LIBRARY_JARS=$(find third_party -name '*.jar' | grep -Fv /javac-9-dev-r3297-4.jar | grep -Fv /javac-9-dev-4023-3.jar | grep -Fv /javac7.jar | grep -Fv JavaBuilder | grep -Fv third_party/guava | grep -Fv third_party/guava | grep -ve 'third_party/grpc/grpc.*jar' | tr "\n" " ")
GRPC_JAVA_VERSION=1.7.0
-GRPC_LIBRARY_JARS=$(find third_party/grpc -name '*.jar' | grep -e .*${GRPC_JAVA_VERSION}.*jar | tr "\n" " ")
+GRPC_LIBRARY_JARS=$(find third_party/grpc -name '*.jar' | grep -e ".*${GRPC_JAVA_VERSION}.*jar" | tr "\n" " ")
GUAVA_VERSION=23.1
-GUAVA_JARS=$(find third_party/guava -name '*.jar' | grep -e .*${GUAVA_VERSION}.*jar | tr "\n" " ")
+GUAVA_JARS=$(find third_party/guava -name '*.jar' | grep -e ".*${GUAVA_VERSION}.*jar" | tr "\n" " ")
LIBRARY_JARS="${LIBRARY_JARS} ${GRPC_LIBRARY_JARS} ${GUAVA_JARS}"
# tl;dr - error_prone_core contains a copy of an older version of guava, so we
diff --git a/scripts/serve-docs.sh b/scripts/serve-docs.sh
index f1dfbd5e18..c4541a84e0 100755
--- a/scripts/serve-docs.sh
+++ b/scripts/serve-docs.sh
@@ -41,7 +41,7 @@ EOF
build_tree() {
bazel build //site:jekyll-tree.tar
- rm -rf $WORKING_DIR/*
+ rm -rf ${WORKING_DIR:-sentinel}/*
tar -xf "$(bazel info bazel-genfiles)/site/jekyll-tree.tar" -C $WORKING_DIR
}