aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Andrew Johnson <ajohnson@stripe.com>2016-12-05 18:27:27 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2016-12-06 12:04:37 +0000
commit1fccb31837f344e05b4e291d117e2b7e26eddc76 (patch)
tree60ce2b10d2f72e8c9301eda3c93a653c3341cf50
parent161c4a34c893bf8e25af00c18e95576bc2f82b5a (diff)
Add quotes around variables when running dirname
If a user happens to have spaces in the path name, `scripts/bootstrap/buildenv.sh` will fail with the error `usage: dirname path`. Quoting the argument to `dirname` when setting `WORKSPACE_DIR` avoids this issue. Closes #2030. -- Reviewed-on: https://github.com/bazelbuild/bazel/pull/2030 PiperOrigin-RevId: 141067912 MOS_MIGRATED_REVID=141067912
-rwxr-xr-xscripts/bootstrap/buildenv.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/bootstrap/buildenv.sh b/scripts/bootstrap/buildenv.sh
index 8345dc307d..dbd7d24b42 100755
--- a/scripts/bootstrap/buildenv.sh
+++ b/scripts/bootstrap/buildenv.sh
@@ -32,7 +32,7 @@ fi
# Set standard variables
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
-WORKSPACE_DIR="$(dirname $(dirname ${DIR}))"
+WORKSPACE_DIR="$(dirname "$(dirname "${DIR}")")"
JAVA_VERSION=${JAVA_VERSION:-1.8}
BAZELRC=${BAZELRC:-"/dev/null"}