Serge Bazanski | 0f8e5a2 | 2021-10-16 20:53:51 +0000 | [diff] [blame] | 1 | # Source this file to have hscloud tools available in your PATH after running |
| 2 | # `bazel run //tools:install`. |
Serge Bazanski | c6fd662 | 2018-11-01 22:39:01 +0100 | [diff] [blame] | 3 | |
| 4 | if [ "$0" == "$BASH_SOURCE" ]; then |
| 5 | echo "You should be sourcing this." |
| 6 | exit 1 |
| 7 | fi |
| 8 | |
Serge Bazanski | 0f8e5a2 | 2021-10-16 20:53:51 +0000 | [diff] [blame] | 9 | hscloud_root="$( cd "$(dirname "$BASH_SOURCE")"; pwd -P )" |
Sergiusz Bazanski | f2a812b | 2019-01-13 17:51:34 +0100 | [diff] [blame] | 10 | if [ ! -f "$hscloud_root/WORKSPACE" ]; then |
| 11 | echo "Could not find WORKSPACE" |
| 12 | exit 1 |
| 13 | fi |
Sergiusz Bazanski | 1663e0e | 2019-07-21 16:25:07 +0200 | [diff] [blame] | 14 | hscloud_path="$hscloud_root/bazel-bin/tools:$hscloud_root/bazel-bin/cluster/tools" |
Sergiusz Bazanski | f2a812b | 2019-01-13 17:51:34 +0100 | [diff] [blame] | 15 | [[ ":$PATH:" != *":$hscloud_path:"* ]] && PATH="$hscloud_path:${PATH}" |
Serge Bazanski | 0f8e5a2 | 2021-10-16 20:53:51 +0000 | [diff] [blame] | 16 | unset -f hscloud_root |
| 17 | unset -f hscloud_path |
Sergiusz Bazanski | f2a812b | 2019-01-13 17:51:34 +0100 | [diff] [blame] | 18 | |
Serge Bazanski | f4313b7 | 2023-10-13 13:42:53 +0200 | [diff] [blame] | 19 | if command -v clang &> /dev/null && [ -z $HSCLOUD_NIX ]; then |
Bartosz Stebel | 2281b5b | 2023-09-23 01:42:20 +0200 | [diff] [blame] | 20 | # 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 |
| 23 | fi |
| 24 | |
Serge Bazanski | 0f8e5a2 | 2021-10-16 20:53:51 +0000 | [diff] [blame] | 25 | # Leftover junk. This should be removed, as env.sh is now optional. |
| 26 | # Do _not_ add more aliases! |
Patryk Jakuszew | 30f9d03 | 2020-06-05 23:37:34 +0200 | [diff] [blame] | 27 | alias bajzel=bazel |
Sergiusz Bazanski | de06180 | 2019-01-13 21:14:02 +0100 | [diff] [blame] | 28 | gpg-unlock() { |
| 29 | echo "test" | gpg2 --sign --batch --no-tty -o /dev/null |
Sergiusz Bazanski | b0b0f3f | 2019-01-13 13:32:19 +0100 | [diff] [blame] | 30 | } |