aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/packages/template_bin.sh
diff options
context:
space:
mode:
authorGravatar Damien Martin-Guillerez <dmarting@google.com>2015-09-04 15:27:45 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-09-04 16:32:25 +0000
commite8f8dc599669a3a1c0a41d7bec95f80deb9203f0 (patch)
tree49c26d48dc464131167c1dc36fc09520e639cc32 /scripts/packages/template_bin.sh
parentd9b512177510640947a2979959f4287e97f35f8f (diff)
Installer: ship the Bash completion script and add a finish message
-- MOS_MIGRATED_REVID=102343488
Diffstat (limited to 'scripts/packages/template_bin.sh')
-rwxr-xr-xscripts/packages/template_bin.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/scripts/packages/template_bin.sh b/scripts/packages/template_bin.sh
index b7b1f77b01..880b430670 100755
--- a/scripts/packages/template_bin.sh
+++ b/scripts/packages/template_bin.sh
@@ -103,12 +103,15 @@ if [ -z "${JAVA_HOME-}" ]; then
case "$(uname -s | tr 'A-Z' 'a-z')" in
linux)
JAVA_HOME="$(readlink -f $(which javac) 2>/dev/null | sed 's_/bin/javac__')" || true
+ BASHRC="~/.bashrc"
;;
freebsd)
JAVA_HOME="/usr/local/openjdk8"
+ BASHRC="~/.bashrc"
;;
darwin)
JAVA_HOME="$(/usr/libexec/java_home -v ${JAVA_VERSION}+ 2> /dev/null)" || true
+ BASHRC="~/.bash_profile"
;;
esac
fi
@@ -139,10 +142,10 @@ fi
mkdir -p ${bin} ${base} ${base}/bin ${base}/etc ${base}/base_workspace
echo -n .
-unzip -q "${BASH_SOURCE[0]}" bazel -d "${base}/bin"
+unzip -q "${BASH_SOURCE[0]}" bazel bazel-complete.bash -d "${base}/bin"
echo -n .
chmod 0755 "${base}/bin/bazel"
-unzip -q "${BASH_SOURCE[0]}" -x bazel -d "${base}/base_workspace"
+unzip -q "${BASH_SOURCE[0]}" -x bazel bazel-complete.bash -d "${base}/base_workspace"
echo -n .
cat >"${base}/etc/bazel.bazelrc" <<EO
build --package_path %workspace%:${base}/base_workspace
@@ -171,4 +174,14 @@ else
echo .
fi
+cat <<EOF
+
+Bazel is now installed!
+
+Make sure you have "${bin}" in your path. You can also activate bash
+completion by adding the following line to your ${BASHRC}:
+ source ${base}/bin/bazel-complete.bash
+
+See http://bazel.io/docs/getting-started.html to start a new project!
+EOF
exit 0