Last active
August 29, 2015 13:55
-
-
Save andrezrv/8777543 to your computer and use it in GitHub Desktop.
Sample additional tasks for WordPress plugins installed via Peasant.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # vvv-init-setup-plugins-post.sh | |
| # | |
| # This file will perform some additional tasks on installed plugins. | |
| # Get Peasant from https://github.com/andrezrv/peasant-vvv-provider. | |
| # Include config file. | |
| this_dir="$(dirname `readlink -f $(dirname $0)/vvv-init.sh`)" | |
| . "${this_dir}/config.sh" | |
| # Get full path to this directory. | |
| link=`readlink -f ${this_dir}/vvv-init.sh` | |
| this_dir_path=`dirname ${link}` | |
| # We're gonna use the content directory a lot, so we store its path into a | |
| # variable. | |
| content="${APPLICATION_PATH}/content" | |
| # Move to application directory | |
| cd "${APPLICATION_PATH}" | |
| # Batcache | |
| if [[ ! -f "${content}/mu-plugins/batcache.php" && -f "${content}/plugins/batcache/batcache.php" ]]; then | |
| # Move to mu-plugins folder. | |
| mv "${content}/plugins/batcache/batcache.php" "${content}/mu-plugins/" | |
| mv "${content}/plugins/batcache/advanced-cache.php" "${content}/" | |
| rm -rf "${content}/plugins/batcache" | |
| # Create Batcache config file. | |
| cp "${APPLICATION_PATH}/cache-config-sample.php" "${APPLICATION_PATH}/cache-config.php" | |
| fi | |
| # APC | |
| if [[ ! -f "${content}/object-cache.php" && -f "${content}/plugins/apc/object-cache.php" ]]; then | |
| # Move to mu-plugins folder. | |
| mv "${content}/plugins/apc/object-cache.php" "${content}/" | |
| rm -rf "${content}/plugins/apc" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment