#!/bin/bash # Install WordPress on Repl.it # # 1. Create a new Repl.it as a PHP Web Server # 2. Update the replit.nix file to include the code in this repo # 3. Restart the Repl # 4. Run this command from the Replit shell: # bash <(curl -s https://raw.githubusercontent.com/ethanpil/wordpress-on-replit/master/install-wordpress-on-replit.sh) echo "Ready to install Wordpress in your Replit." echo "Did you make sure you configure your replit.nix files before running this script?" read -p "Continue? " prompt if [[ $prompt == "N" || $prompt == "n" || $prompt == "No" || $prompt == "no" ]]; then exit 0 fi #Make sure steps 1-3 are completed before installing Wordpress if ! [ -x "$(command -v less)" ]; then echo 'Error: less is not installed. Please make sure you have updated the replit.nix file and restarted the Repl.' >&2 exit 1 fi if ! [ -x "$(command -v wp)" ]; then echo 'Error: wp-cli is not installed. Please make sure you have updated the replit.nix file and restarted the Repl.' >&2 exit 1 fi #Make sure we're in the right place! cd ~/$REPL_SLUG #remove default repl.it code file rm ~/$REPL_SLUG/index.php #Download Wordpress! wp core download #SQLITE Plugin: Download, extract and cleanup sqlite plugin for WP curl -LG https://raw.githubusercontent.com/aaemnnosttv/wp-sqlite-db/master/src/db.php > ./wp-content/db.php #Create dummy config to be overruled by sqlite plugin wp config create --skip-check --dbname=wp --dbuser=wp --dbpass=pass --extra-php <