Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions actions/st2_chg_ver_for_st2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down