1#!/usr/bin/env nix-shell
2#!nix-shell -i bash -p bash wget coreutils nix
3version=$1
4
5if [[ -z $version ]]
6then
7 echo "Pass the version to get hashes for as an argument"
8 exit 1
9fi
10
11allOutput=""
12
13dlDest=$(mktemp)
14
15trap 'rm $dlDest' EXIT
16
17for plat in osx linux; do
18 for arch in x64 arm64; do
19
20 URL="https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-$plat-$arch.tar.gz"
21 wget $URL -O $dlDest >&2
22
23 hash=$(nix hash file $dlDest)
24
25 allOutput+="
26variant: $plat $arch
27hash: $hash
28"
29
30 done
31done
32
33echo "$allOutput"