aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-homebrew.sh17
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"
}