From 421bfb3a2373afab67c97a7cf2b1745432fbcea8 Mon Sep 17 00:00:00 2001 From: blag Date: Sun, 4 Jul 2021 17:41:32 -0700 Subject: [PATCH] Update st2_chg_ver_for_st2.sh --- actions/st2_chg_ver_for_st2.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/actions/st2_chg_ver_for_st2.sh b/actions/st2_chg_ver_for_st2.sh index 6cb265b4..1d11aa85 100644 --- a/actions/st2_chg_ver_for_st2.sh +++ b/actions/st2_chg_ver_for_st2.sh @@ -71,12 +71,15 @@ do exit 1 fi - VERSION_STR="__version__ = '${VERSION}'" + # The black lint checker forces us to use double quotes for these + # but we check for both single quotes and double quotes to ensure + # that we find them all + VERSION_STR="__version__ = ['\"]${VERSION}['\"]" VERSION_STR_MATCH=`grep "${VERSION_STR}" ${INIT_FILE} || true` if [[ -z "${VERSION_STR_MATCH}" ]]; then echo "Setting version in ${INIT_FILE} to ${VERSION}..." - sed -i -e "s/\(__version__ = \).*/\1'${VERSION}'/" ${INIT_FILE} + sed -i -e "s/\(__version__ = \).*/\1\"${VERSION}\"/" ${INIT_FILE} VERSION_STR_MATCH=`grep "${VERSION_STR}" ${INIT_FILE} || true` if [[ -z "${VERSION_STR_MATCH}" ]]; then