about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/electron/print-hashes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/tools/electron/print-hashes.sh')
-rwxr-xr-xnixpkgs/pkgs/development/tools/electron/print-hashes.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/electron/print-hashes.sh b/nixpkgs/pkgs/development/tools/electron/print-hashes.sh
new file mode 100755
index 000000000000..203e5a4dfec6
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/electron/print-hashes.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+set -eu -o pipefail
+
+if [[ $# -lt 1 ]]; then
+    echo "$0: version" >&2
+    exit 1
+fi
+
+
+VERSION=$1
+
+declare -A SYSTEMS HASHES
+SYSTEMS=(
+    [i686-linux]=linux-ia32
+    [x86_64-linux]=linux-x64
+    [armv7l-linux]=linux-armv7l
+    [aarch64-linux]=linux-arm64
+    [x86_64-darwin]=darwin-x64
+)
+
+for S in "${!SYSTEMS[@]}"; do
+  HASHES["$S"]=$(nix-prefetch-url "https://github.com/electron/electron/releases/download/v${VERSION}/electron-v${VERSION}-${SYSTEMS[$S]}.zip")
+done
+
+for S in "${!HASHES[@]}"; do
+    echo "$S"
+    echo "sha256 = \"${HASHES[$S]}\";"
+done