From 5c6136dfc6fe21ae9de77553227985f1430ad71f Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 13 Oct 2025 11:51:27 -0400 Subject: Cleanup homebrew formula update --- scripts/update-homebrew.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'scripts') diff --git a/scripts/update-homebrew.sh b/scripts/update-homebrew.sh index b3062fa..59ffdfb 100755 --- a/scripts/update-homebrew.sh +++ b/scripts/update-homebrew.sh @@ -124,16 +124,13 @@ update_formula() { exit 1 fi - # Update URL with new commit SHA - sed -i.bak -E "s|url \"https://git.sr.ht/~eugenetriguba/bolt/archive/[^\"]+\"|url \"https://git.sr.ht/~eugenetriguba/bolt/archive/${commit_sha}.tar.gz\"|" "$formula_path" - - # Update version - sed -i.bak -E "s|version \"[^\"]+\"|version \"${version}\"|" "$formula_path" - - # Update sha256 - sed -i.bak -E "s|sha256 \"[^\"]+\"|sha256 \"${sha256}\"|" "$formula_path" - - rm -f "$formula_path.bak" + local temp_file="$formula_path.tmp" + sed -E \ + -e "s|url \"https://git.sr.ht/~eugenetriguba/bolt/archive/[^\"]+\"|url \"https://git.sr.ht/~eugenetriguba/bolt/archive/${commit_sha}.tar.gz\"|" \ + -e "s|version \"[^\"]+\"|version \"${version}\"|" \ + -e "s|sha256 \"[^\"]+\"|sha256 \"${sha256}\"|" \ + "$formula_path" >"$temp_file" + mv "$temp_file" "$formula_path" log_substep "Updated $FORMULA_FILE" } -- cgit v1.2.3