Skip to content

Commit

Permalink
Change update version script to only grep first instance
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewcarbone committed Feb 15, 2024
1 parent 1290690 commit 5652303
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ replace_version_in_init () {
}

reset_version_to_ellipsis () {
current_version=$(grep "__version__" "$PACKAGE_NAME"/__init__.py)
# we only grep the first instance of __version__
current_version=$(grep -m 1 "__version__" "$PACKAGE_NAME"/__init__.py)
sed_command="s/$current_version/__version__ = ... # semantic-version-placeholder/g"
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "$sed_command" "$PACKAGE_NAME"/__init__.py
Expand Down

0 comments on commit 5652303

Please sign in to comment.