Serge Bazanski | c6fd662 | 2018-11-01 22:39:01 +0100 | [diff] [blame] | 1 | # source me to have all the nice things |
| 2 | |
| 3 | if [ "$0" == "$BASH_SOURCE" ]; then |
| 4 | echo "You should be sourcing this." |
| 5 | exit 1 |
| 6 | fi |
| 7 | |
Sergiusz Bazanski | de06180 | 2019-01-13 21:14:02 +0100 | [diff] [blame] | 8 | export hscloud_root="$( cd "$(dirname "$BASH_SOURCE")"; pwd -P )" |
Serge Bazanski | c6fd662 | 2018-11-01 22:39:01 +0100 | [diff] [blame] | 9 | |
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 |
| 14 | |
Sergiusz Bazanski | 1663e0e | 2019-07-21 16:25:07 +0200 | [diff] [blame] | 15 | 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] | 16 | |
| 17 | [[ ":$PATH:" != *":$hscloud_path:"* ]] && PATH="$hscloud_path:${PATH}" |
| 18 | |
Sergiusz Bazanski | c5a77b8 | 2020-02-17 23:04:35 +0100 | [diff] [blame] | 19 | # Detect NixOS |
| 20 | if [ -d /nix ] && [ ! -f /lib/ld-linux.so.2 ]; then |
Piotr Dobrowolski | 2259437 | 2020-03-21 23:44:10 +0100 | [diff] [blame^] | 21 | export hscloud_nixos=true |
Sergiusz Bazanski | c5a77b8 | 2020-02-17 23:04:35 +0100 | [diff] [blame] | 22 | fi |
| 23 | |
Sergiusz Bazanski | de06180 | 2019-01-13 21:14:02 +0100 | [diff] [blame] | 24 | gpg-unlock() { |
| 25 | echo "test" | gpg2 --sign --batch --no-tty -o /dev/null |
Sergiusz Bazanski | b0b0f3f | 2019-01-13 13:32:19 +0100 | [diff] [blame] | 26 | } |