Skip to content

Instantly share code, notes, and snippets.

@trajche
Last active August 4, 2022 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trajche/bc2f70215a3c6e8dfb266f945c09708a to your computer and use it in GitHub Desktop.
Save trajche/bc2f70215a3c6e8dfb266f945c09708a to your computer and use it in GitHub Desktop.
Download and install WP in a Git directory
#!/bin/bash
if ! [[ -d ./wp-content ]]
then
echo "./wp-content doesn't exist in this directory. please make sure you are in a digitalnode wp instance."
exit
fi
if ! command -v wp &> /dev/null
then
echo "wp could not be found. please install wp-cli."
exit
fi
echo "Making tmp dir..."
mkdir ./dn-tmp
cd ./dn-tmp
wp core download
rsync -av --progress ./ ./../ --exclude wp-content
echo "Clearning up..."
rm -rf ./../dn-tmp
echo "Don't forget to make your own wp-config.php file and import/configure your database!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment