Skip to content

Commit 89d1686

Browse files
committed
chore: Make release scripts work on mac OS
1 parent 7af1289 commit 89d1686

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

scripts/release.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
set -e
44

5+
# Fixes a dumb issue where Mac's don't come with GNU sed out of the box.
6+
sed=$(which {gsed,sed} | head -n1)
7+
58
help() {
69
cat <<- EOF
710
Usage: TAG=tag $0
@@ -42,12 +45,12 @@ fi
4245
git checkout v10
4346

4447
PACKAGE_DIRS=$(find . -mindepth 2 -type f -name 'go.mod' -exec dirname {} \; \
45-
| sed 's/^\.\///' \
48+
| $sed 's/^\.\///' \
4649
| sort)
4750

4851
for dir in $PACKAGE_DIRS
4952
do
50-
sed --in-place \
53+
$sed --in-place \
5154
"s/go-pg\/pg\([^ ]*\) v.*/go-pg\/pg\1 ${TAG}/" "${dir}/go.mod"
5255
done
5356

@@ -57,7 +60,7 @@ do
5760
(cd ./${dir} && go get -d && go mod tidy)
5861
done
5962

60-
sed --in-place "s/\(return \)\"[^\"]*\"/\1\"${TAG#v}\"/" ./version.go
63+
$sed --in-place "s/\(return \)\"[^\"]*\"/\1\"${TAG#v}\"/" ./version.go
6164

6265
git checkout -b release/${TAG} v10
6366
git add -u

0 commit comments

Comments
 (0)