diff options
| author | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-13 11:51:27 -0400 |
|---|---|---|
| committer | Eugene Triguba <hello@eugenetriguba.com> | 2025-10-13 11:51:27 -0400 |
| commit | 5c6136dfc6fe21ae9de77553227985f1430ad71f (patch) | |
| tree | 88f1cce8933ecd4cbea02540154daf913d997e1a | |
| parent | Update contributing guide (diff) | |
| download | cli-5c6136dfc6fe21ae9de77553227985f1430ad71f.zip | |
Cleanup homebrew formula update
| -rwxr-xr-x | scripts/update-homebrew.sh | 17 |
1 files changed, 7 insertions, 10 deletions
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" } |