wordpress/build/patch-util/rootfs/wp/entrypoint.sh
xZero707 a03f12990b
Update regex so only last zero matches
Fixes the bug with newer sed versions
2022-07-25 23:51:18 +02:00

25 lines
562 B
Bash
Executable File

#!/usr/bin/env sh
echo "> Downloading WordPress ${WP_VERSION} ..."
# Removes trailing zero if found
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}"
if [ ! -f "/tmp/wp-admin/update-core.php" ]; then
echo "X WordPress download failed"
exit 1
fi
mkdir src -p
rm src/* -f
cp /tmp/wp-admin/update-core.php src/
cp src/update-core.php src/mod-update-core.php
echo "> Files ready."
exit 0