aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/compilers/go/print-hashes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/compilers/go/print-hashes.sh')
-rwxr-xr-xinfra/libkookie/nixpkgs/pkgs/development/compilers/go/print-hashes.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/go/print-hashes.sh b/infra/libkookie/nixpkgs/pkgs/development/compilers/go/print-hashes.sh
new file mode 100755
index 000000000000..97be7d189ad8
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/go/print-hashes.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+BASEURL=https://golang.org/dl/
+VERSION=${1:-}
+
+if [[ -z $VERSION ]]
+then
+ echo "No version supplied"
+ exit -1
+fi
+
+curl -s "${BASEURL}?mode=json&include=all" | \
+ jq '.[] | select(.version == "go'${VERSION}'")' | \
+ jq -r '.files[] | select(.kind == "archive" and (.os == "linux" or .os == "darwin")) | (.os + "-" + .arch + " = \"" + .sha256 + "\";")'