1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00

powershell: add maintainer script getHashes

This commit is contained in:
Anselm Schüler 2022-05-26 05:17:02 +02:00
parent cf22e7bdd0
commit 1461002cc8

View file

@ -0,0 +1,36 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash wget coreutils gnutar nix
version=$1
if [[ -z $version ]]
then
echo "Pass the version to get hashes for as an argument"
exit 1
fi
allOutput=""
dlDest=$(mktemp)
exDest=$(mktemp -d)
trap 'rm $dlDest; rm -r $exDest' EXIT
for plat in osx linux; do
for arch in x64 arm64; do
URL="https://github.com/PowerShell/PowerShell/releases/download/v$version/powershell-$version-$plat-$arch.tar.gz"
wget $URL -O $dlDest >&2
tar -xzf $dlDest -C $exDest >&2
hash=$(nix hash path $exDest)
allOutput+="
variant: $plat $arch
hash: $hash
"
done
done
echo "$allOutput"