aboutsummaryrefslogtreecommitdiffhomepage
path: root/compile.sh
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-05-12 14:48:12 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-05-15 09:35:12 +0000
commitfeb09392389fa0fedbd364e1c90e86358014a051 (patch)
tree12d070907fecebd658b69a5378e7b85ba155f839 /compile.sh
parent2099da0a6a810e151e77bff88ed14ee386faee6f (diff)
Test for existence of $HOME before writing ~/.bazelrc in compile.sh
Without that change, the compile.sh script fails when $HOME is unset. -- MOS_MIGRATED_REVID=93412872
Diffstat (limited to 'compile.sh')
-rwxr-xr-xcompile.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/compile.sh b/compile.sh
index 302d3f327e..cb5c23add2 100755
--- a/compile.sh
+++ b/compile.sh
@@ -484,7 +484,11 @@ cp -f output/actoolzip/precomp_actoolzip_deploy.jar output/ibtoolzip/precomp_ibt
# Create a bazelrc file with the base_workspace directory in the package path.
package_path="build --package_path %workspace%:$base_workspace"
-if [ ! -f $HOME/.bazelrc ]; then
+if [ -z "${HOME-}" ]; then
+ warning="No \$HOME variable set, cannot write .bazelrc file."
+ warning="$warning Consider adding $base_workspace to your package path"
+ log $warning
+elif [ ! -f $HOME/.bazelrc ]; then
log "Creating a .bazelrc pointing to $base_workspace"
cat > $HOME/.bazelrc <<EOF
$package_path