Skip to content

Commit

Permalink
scripts: support for both macOS and regular sed
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Jan 25, 2024
1 parent 20b6222 commit 1af36b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/publish-git-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ function updateSdkReferenceAndCommitChanges {
cd "${directory}"

echo "Updating the dependency on 'github.com/hashicorp/go-azure-sdk/sdk'.."
sed -i "s/github.com\/hashicorp\/go-azure-sdk\/sdk.*/github.com\/hashicorp\/go-azure-sdk\/sdk $tag/g" go.mod
if [[ $(uname) == "Darwin" ]]; then
echo "Using BSD sed"
sed -i "" "s/github.com\/hashicorp\/go-azure-sdk\/sdk.*/github.com\/hashicorp\/go-azure-sdk\/sdk $tag/g" go.mod
else
sed -i "s/github.com\/hashicorp\/go-azure-sdk\/sdk.*/github.com\/hashicorp\/go-azure-sdk\/sdk $tag/g" go.mod
fi

echo "Running 'go mod tidy'.."
go mod tidy
Expand Down

0 comments on commit 1af36b0

Please sign in to comment.