From e6be5e73b6827d6397152af4a6fcc09fd2d2d7ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Mon, 13 Sep 2021 09:12:09 +0300 Subject: [PATCH] update .envrc --- .envrc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.envrc b/.envrc index 92ee812..59626ce 100644 --- a/.envrc +++ b/.envrc @@ -1,24 +1,27 @@ set -euo pipefail export PATH="$(git rev-parse --show-toplevel)/bin:$PATH" +_u=https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk- -fetch() { - direnv fetchurl "https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-$1-$2" "$3" -} +#for os in linux darwin; do +# for arch in amd64 arm64; do +# hash=$(direnv fetchurl "${_u}$os-$arch") +# echo -e "$os-$arch\t$hash" +# done +#done case "$(uname | tr A-Z a-z)-$(uname -m)" in linux-x86_64) - bzl=$(fetch linux amd64 sha256-TLU0xSzdR6YiPUWW1TDnyceFQ4qzsKSf80fpkcIQss0=);; + bzl=$(direnv fetchurl "${_u}linux-amd64" sha256-TLU0xSzdR6YiPUWW1TDnyceFQ4qzsKSf80fpkcIQss0=);; linux-aarch64) - bzl=$(fetch linux arm64 sha256-wd5oYN1PjV4uwnAJe9RtaiEblxoLizhVl4S9BR6pUKE=);; + bzl=$(direnv fetchurl "${_u}linux-arm64" sha256-wd5oYN1PjV4uwnAJe9RtaiEblxoLizhVl4S9BR6pUKE=);; darwin-x86_64) - bzl=$(fetch darwin arm64 sha256-wi1IYBRm2dOwQ8zXQFHy9CMPm59FCfCXAXyXMDqojRM=);; + bzl=$(direnv fetchurl "${_u}darwin-amd64" sha256-5IW7+EUy0CpgsOsjxwJhC1QI3zoZkIek8rXgmVu/LVo=);; darwin-aarch64) - bzl=$(fetch darwin arm64 sha256-5IW7+EUy0CpgsOsjxwJhC1QI3zoZkIek8rXgmVu/LVo=);; + bzl=$(direnv fetchurl "${_u}darwin-arm64" sha256-wi1IYBRm2dOwQ8zXQFHy9CMPm59FCfCXAXyXMDqojRM=);; *) >&2 echo "unsupported architecture tuple $(uname | tr A-Z a-z)-$(uname -m)" exit 1;; esac -chmod a+x "${bzl}" ln -sf "${bzl}" bin/bazel