Fix sed commands in update-cursor.sh to properly update all fields

- Fixed version update to not require specific comment
- Fixed URL and SHA256 updates to target correct block (cursor = buildCursor {)
- All three fields (version, url, sha256) now update correctly
This commit is contained in:
TudorAndrei
2025-10-10 23:32:10 +03:00
parent 880062540c
commit b0e626ff16
+3 -3
View File
@@ -61,9 +61,9 @@ update_flake() {
cp "$FLAKE_FILE" "$FLAKE_FILE.backup"
# Update flake.nix - be more specific to avoid replacing nixpkgs URL
sed -i "s/version = \"[^\"]*\" # Will be updated by GitHub Actions/version = \"$version\"/" "$FLAKE_FILE"
sed -i "/buildCursor = {/,/};/s|url = \"[^\"]*\"|url = \"$actual_url\"|" "$FLAKE_FILE"
sed -i "/buildCursor = {/,/};/s/sha256 = \"[^\"]*\"/sha256 = \"$sha256\"/" "$FLAKE_FILE"
sed -i "s/version = \"[^\"]*\"/version = \"$version\"/" "$FLAKE_FILE"
sed -i "/cursor = buildCursor {/,/};/s|url = \"[^\"]*\"|url = \"$actual_url\"|" "$FLAKE_FILE"
sed -i "/cursor = buildCursor {/,/};/s/sha256 = \"[^\"]*\"/sha256 = \"$sha256\"/" "$FLAKE_FILE"
echo "Updated flake.nix with version $version"
}