Skip to content

Commit ae7e50d

Browse files
committed
Fix sed call on MacOS
The sed call would always leave a "go.mod''" since the expansion was quoting the quotes again. Signed-off-by: Nelo-T. Wallus <[email protected]>
1 parent f3a4fee commit ae7e50d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

hack/bump-k8s.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,10 @@ current_version="$( GOPROXY=direct go mod edit -json | jq '.Replace[] | select(.
3535

3636
# equivalent to go mod edit -replace
3737
is_gnu_sed() { sed --version >/dev/null 2>&1; }
38-
if is_gnu_sed; then
39-
SED="sed -i"
40-
else
41-
SED="sed -i ''"
38+
sed_args=( -i )
39+
if ! is_gnu_sed; then
40+
sed_args+=( "" )
4241
fi
43-
${SED} -e "s|${current_version}|${BRANCH}|g" -E -e "s,=> github.com/kcp-dev/kubernetes,=> github.com/${GITHUB_USER}/${GITHUB_REPO},g" go.mod
42+
sed "${sed_args[@]}" -e "s|${current_version}|${BRANCH}|g" -E -e "s,=> github.com/kcp-dev/kubernetes,=> github.com/${GITHUB_USER}/${GITHUB_REPO},g" go.mod
4443

4544
GOPROXY=direct go mod tidy

0 commit comments

Comments
 (0)