blob: d9259f34522483e66f8b341b87903f048e49d372 [file] [log] [blame]
Serge Bazanski0f8e5a22021-10-16 20:53:51 +00001# Source this file to have hscloud tools available in your PATH after running
2# `bazel run //tools:install`.
Serge Bazanskic6fd6622018-11-01 22:39:01 +01003
4if [ "$0" == "$BASH_SOURCE" ]; then
5 echo "You should be sourcing this."
6 exit 1
7fi
8
Serge Bazanski0f8e5a22021-10-16 20:53:51 +00009hscloud_root="$( cd "$(dirname "$BASH_SOURCE")"; pwd -P )"
Sergiusz Bazanskif2a812b2019-01-13 17:51:34 +010010if [ ! -f "$hscloud_root/WORKSPACE" ]; then
11 echo "Could not find WORKSPACE"
12 exit 1
13fi
Sergiusz Bazanski1663e0e2019-07-21 16:25:07 +020014hscloud_path="$hscloud_root/bazel-bin/tools:$hscloud_root/bazel-bin/cluster/tools"
Sergiusz Bazanskif2a812b2019-01-13 17:51:34 +010015[[ ":$PATH:" != *":$hscloud_path:"* ]] && PATH="$hscloud_path:${PATH}"
Serge Bazanski0f8e5a22021-10-16 20:53:51 +000016unset -f hscloud_root
17unset -f hscloud_path
Sergiusz Bazanskif2a812b2019-01-13 17:51:34 +010018
Serge Bazanskif4313b72023-10-13 13:42:53 +020019if command -v clang &> /dev/null && [ -z $HSCLOUD_NIX ]; then
Bartosz Stebel2281b5b2023-09-23 01:42:20 +020020 # if we have clang, use it
21 # avoids weird PATH issues with linkers, eg https://github.com/bazelbuild/bazel/issues/18834
22 export CC=clang
23fi
24
Serge Bazanski0f8e5a22021-10-16 20:53:51 +000025# Leftover junk. This should be removed, as env.sh is now optional.
26# Do _not_ add more aliases!
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020027alias bajzel=bazel
Sergiusz Bazanskide061802019-01-13 21:14:02 +010028gpg-unlock() {
29 echo "test" | gpg2 --sign --batch --no-tty -o /dev/null
Sergiusz Bazanskib0b0f3f2019-01-13 13:32:19 +010030}