This commit is contained in:
21
scripts/update-pob.sh
Executable file
21
scripts/update-pob.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
# TODO: Update pobfrontend as well?
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
nurl_output=$(nurl -j https://github.com/PathOfBuildingCommunity/PathOfBuilding 2>/dev/null)
|
||||
rev=$(jq '.args.rev' <<< "$nurl_output")
|
||||
else
|
||||
nurl_output=$(nurl -j https://github.com/PathOfBuildingCommunity/PathOfBuilding "$1" 2>/dev/null)
|
||||
fi
|
||||
|
||||
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")
|
||||
|
||||
sed -i "${line_data}s/.*/ rev = $rev;/" packages/pob.nix
|
||||
nixfmt packages/pob.nix
|
Reference in New Issue
Block a user