Skip to content

Commit

Permalink
Fail if plugin installation produces unexpected output
Browse files Browse the repository at this point in the history
See #5
  • Loading branch information
JDGrimes authored Oct 9, 2017
1 parent 94c7ef9 commit a19834f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/WPPPB/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function add_php_file( $file, $when = 'after', $data = array() ) {
*/
public function install_plugins() {

system(
$result = system(
WP_PHP_BINARY
. ' ' . escapeshellarg( dirname( dirname( __FILE__ ) ) . '/bin/install-plugins.php' )
. ' ' . escapeshellarg( json_encode( $this->plugins ) )
Expand All @@ -150,6 +150,9 @@ public function install_plugins() {
if ( 0 !== $exit_code ) {
echo( 'Remote plugin installation failed with exit code ' . $exit_code . PHP_EOL );
exit( 1 );
} elseif ( ! empty( $result ) ) {
echo( PHP_EOL . 'Remote plugin installation produced unexpected output.' . PHP_EOL );
exit( 1 );
}

// The caching functions may not be loaded yet.
Expand Down

0 comments on commit a19834f

Please sign in to comment.