wordpress/build/patch-util/00-download-file.sh

33 lines
980 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env sh
set -e
2021-09-23 17:44:41 +02:00
WP_VERSION="${1:-}"
if [ -z "${WP_VERSION}" ]; then
echo "> Error: WP_VERSION is not specified"
exit 1
fi
echo "> Building helper image..."
2021-09-23 17:44:41 +02:00
docker build --build-arg "WP_VERSION=${WP_VERSION}" -t local/wp-patch-util .
mkdir wp-src/ -p
echo ""
echo "> Running helper container..."
USER_ID=$(id -u "${USER}")
GROUP_ID=$(id -g "${USER}")
docker run --rm -t --name="wp-patch-util-$(date +%s)" -v "${PWD}/wp-src:/wp/src" -e "UID=${USER_ID}" -e "GID=${GROUP_ID}" local/wp-patch-util
sudo chown "${USER}:${USER}" wp-src -R
echo ""
echo ""
echo "> Two files are now downloaded to wp-src"
echo "> Please update wp-src/mod-update-core.php with code bellow and then execute ./01-create-patch.sh"
echo ""
echo ""
2023-04-02 20:31:39 +02:00
echo " wp_die("
echo " __( 'Sorry, you are not allowed to update this site.' ) ."
echo " ' Click <a href=\"https://github.com/N0rthernL1ghts/wordpress/wiki/WordPress-Core-Updates\" target=\"_blank\">here</a> to learn why.'"
echo " );"
2021-09-23 17:44:41 +02:00
echo ""