ataylorme / Advanced-WordPress-on-Pantheon

MIT License
65 stars 32 forks source link

Move part of build.sh to post composer hook #49

Closed tobeycodes closed 7 years ago

tobeycodes commented 7 years ago

https://github.com/ataylorme/Advanced-WordPress-on-Pantheon/blob/master/bin/build.sh#L42-L49

This should be moved to a post-install and post-update command so you can run composer install locally and not move the files manually.

My ./bin/setup

#!/bin/bash

if [ -d "vendor/wp-coding-standards/wpcs" ]; then
    echo "Importing WordPress Coding Standards"
    ./bin/phpcs --config-set installed_paths vendor/wp-coding-standards/wpcs > /dev/null
fi

if [ -d "web/wp/wp-content/mu-plugins" ]; then
    echo "Importing Pantheon MU-Plugins"
    rsync -a web/wp/wp-content/mu-plugins/* web/wp-content/mu-plugins/
fi

if [ -f "./web/wp/wp-config.php" ]; then
    echo "Removing ./wp-config.php from ./web/wp"
    rm -rf ./web/wp/wp-config.php
fi

if [ -d "./web/wp/wp-content" ]; then
    echo "Removing ./wp-content from ./web/wp"
    rm -rf ./web/wp/wp-content
fi

My composer.json


  "post-install-cmd": "./bin/setup",
  "post-update-cmd": "./bin/setup"
}```
ataylorme commented 7 years ago

This has been moved to a prepareForPantheon method in scripts/composer/ScriptHandler.php