ps2.live/scripts/update-vendor-hash.sh
2025-04-14 20:18:58 -07:00

11 lines
No EOL
437 B
Bash
Executable file

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p nix -p coreutils -p gnused -p gawk -p prefetch-npm-deps
set -exuo pipefail
# Go
go mod tidy
failedbuild=$(nix build --impure --expr '(with import <nixpkgs> {}; pkgs.callPackage ./. { vendorHash = ""; }).ps2live' 2>&1 || true)
echo "$failedbuild"
checksum=$(echo "$failedbuild" | awk '/got:.*sha256/ { print $2 }')
sed -i -e "s|vendorHash ? \".*\"|vendorHash ? \"$checksum\"|" default.nix