Update regex so only last zero matches

Fixes the bug with newer sed versions
This commit is contained in:
Aleksandar Puharic 2022-07-25 23:51:18 +02:00
parent 6cbd0dd438
commit a03f12990b
Signed by: xZero707
GPG Key ID: 3CC53DCAA9C237BB
2 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,7 @@
echo "> Downloading WordPress ${WP_VERSION} ..."
# Removes trailing zero if found
WP_SHORT_VERSION=$(echo "${WP_VERSION}" | sed --expression='s/.0//g');
WP_SHORT_VERSION=$(echo "${WP_VERSION}" | sed --expression='s/.0$//g');
echo "> Short Version: ${WP_SHORT_VERSION}"
wp --allow-root --path="/tmp" core download --locale="${WP_LOCALE}" --version="${WP_SHORT_VERSION}"

View File

@ -7,7 +7,7 @@ DISABLE_WP_UPDATES="${ENFORCE_DISABLE_WP_UPDATES:-true}"
# Removes trailing zero if found
# This is required due to inconsistencies between WodPress docker image versioning and wp-cli core download
# If patch version is 0, it is not considered by wp-cli.
WP_VERSION=$(echo "${WP_VERSION}" | sed --expression='s/.0//g');
WP_VERSION=$(echo "${WP_VERSION}" | sed --expression='s/.0$//g');
function disableUpdatesPatch() {
if [ "${DISABLE_WP_UPDATES}" != "false" ]; then