From f556ff066f3af9d1e81140d491ebcd6eb56a910c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Fri, 19 Jul 2024 20:44:07 +0200 Subject: [PATCH] Fix pob update script --- packages/pob.nix | 4 ++-- scripts/update-pob.sh | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/pob.nix b/packages/pob.nix index 0a71786..f80b3cd 100644 --- a/packages/pob.nix +++ b/packages/pob.nix @@ -19,8 +19,8 @@ let src = fetchFromGitHub { owner = "PathOfBuildingCommunity"; repo = "PathOfBuilding"; - rev = "520e4aea9583ce33bf2c1494fc1b5dc128696797"; - hash = "sha256-E7UgJpsC0YnqG2KbZYxbYRDPoZ2+NfyYCn4fK+QN5WM="; + rev = "b28c9cd74b664a9af3fb8d72416afebe140b350a"; + hash = "sha256-fxpxuS64MpHJrq1tqrhZFKF0wz7phyijLIHEuxzUfa0="; }; nativeBuildInputs = [ unzip ]; diff --git a/scripts/update-pob.sh b/scripts/update-pob.sh index a11e363..04005dd 100755 --- a/scripts/update-pob.sh +++ b/scripts/update-pob.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash set -eo pipefail +set -x # TODO: Update pobfrontend as well? @@ -14,8 +15,12 @@ hash=$(jq '.args.hash' <<< "$nurl_output") echo "Updating pob to $rev" # Find lines to replace -line_numbers=$(grep -Fn "rev =" packages/pob.nix| cut -d":" -f1) -line_data=$(head -n1 <<< "$line_numbers") +rev_line_numbers=$(grep -Fn "rev =" packages/pob.nix| cut -d":" -f1) +rev_line_data=$(head -n1 <<< "$rev_line_numbers") +sed -i "${rev_line_data}s/.*/ rev = $rev;/" packages/pob.nix + +hash_line_numbers=$(grep -Fn "hash =" packages/pob.nix| cut -d":" -f1) +hash_line_data=$(head -n1 <<< "$hash_line_numbers") +sed -i "${hash_line_data}s/.*/ hash = $hash;/" packages/pob.nix -sed -i "${line_data}s/.*/ rev = $rev;/" packages/pob.nix nixfmt packages/pob.nix