aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2025-08-06 15:08:32 +0200
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2025-08-06 15:08:32 +0200
commita848611f9a3ac48b81c5fdcfdc1e8bd8b9de62a6 (patch)
treeca5590eb0b4ff35541e197eb5bbfdcd5f3bfd30c
parent3f79644b72e928c529febc1aaee081a6c4b96be3 (diff)
downloadjquery-a848611f9a3ac48b81c5fdcfdc1e8bd8b9de62a6.tar.gz
jquery-a848611f9a3ac48b81c5fdcfdc1e8bd8b9de62a6.zip
Build: Make the sed usage portable across Linux & macOSHEADmain
On macOS (which uses the BSD-variant of sed), the `-i` flag requires its “backup extension” to come immediately after the i (with a space), even if it’s empty; this made the release `sed` commands fail on macOS. The GNU sed doesn’t require an extension but it allows it. To make the commands work both on macOS & Linux, make the following changes: 1. Always specify the backup extension. 2. Explicitly specify the script part by using the `-e` flag. 3. To simplify the patterns, use `|` as a separator instead of `/`; then slashes don't need to be escaped in the script parts.
-rw-r--r--.release-it.cjs2
-rw-r--r--build/release/post-release.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/.release-it.cjs b/.release-it.cjs
index d5d8ec921..425e9d313 100644
--- a/.release-it.cjs
+++ b/.release-it.cjs
@@ -11,7 +11,7 @@ module.exports = {
hooks: {
"before:init": "bash ./build/release/pre-release.sh",
"after:version:bump":
- "sed -i 's/main\\/AUTHORS.txt/${version}\\/AUTHORS.txt/' package.json",
+ "sed -i '' -e 's|main/AUTHORS.txt|${version}/AUTHORS.txt|' package.json",
"after:bump": "cross-env VERSION=${version} npm run build:all",
"before:git:release": "git add -f dist/ dist-module/ changelog.md",
"after:release": "echo 'Run the following to complete the release:' && " +
diff --git a/build/release/post-release.sh b/build/release/post-release.sh
index 6cc4d6517..271c00734 100644
--- a/build/release/post-release.sh
+++ b/build/release/post-release.sh
@@ -43,7 +43,7 @@ git push --follow-tags
cd -
# Restore AUTHORS URL
-sed -i "s/$1\/AUTHORS.txt/main\/AUTHORS.txt/" package.json
+sed -i '' -e "s|$1/AUTHORS.txt|main/AUTHORS.txt|" package.json
git add package.json
# Remove built files from tracking.