From 56523037eaa779c1c3dc7be596691a29e1b9a143 Mon Sep 17 00:00:00 2001 From: Matthew Carbone Date: Thu, 15 Feb 2024 14:16:17 -0500 Subject: [PATCH] Change update version script to only grep first instance --- scripts/update_version.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/update_version.sh b/scripts/update_version.sh index 0bd018e..db98116 100644 --- a/scripts/update_version.sh +++ b/scripts/update_version.sh @@ -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