From 72d8062072f49898f79c5e30a4f66f6ce7b8bea3 Mon Sep 17 00:00:00 2001 From: scribu Date: Tue, 12 Nov 2013 00:21:29 +0200 Subject: [PATCH] introduce --skip-tests flag for 'wp scaffold plugin' --- php/commands/scaffold.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/php/commands/scaffold.php b/php/commands/scaffold.php index 31e67210..26ee0064 100644 --- a/php/commands/scaffold.php +++ b/php/commands/scaffold.php @@ -303,11 +303,14 @@ class Scaffold_Command extends WP_CLI_Command { * * : The internal name of the plugin. * - * [--activate] - * : Activate the newly generated plugin. - * * [--plugin_name=] * : What to put in the 'Plugin Name:' header + * + * [--skip-tests] + * : Don't generate files for unit testing. + * + * [--activate] + * : Activate the newly generated plugin. */ function plugin( $args, $assoc_args ) { $plugin_slug = $args[0]; @@ -325,10 +328,13 @@ class Scaffold_Command extends WP_CLI_Command { WP_CLI::success( "Created $plugin_dir" ); - WP_CLI::run_command( array( 'scaffold', 'plugin-tests', $plugin_slug ) ); + if ( !isset( $assoc_args['skip-tests'] ) ) { + WP_CLI::run_command( array( 'scaffold', 'plugin-tests', $plugin_slug ) ); + } - if ( isset( $assoc_args['activate'] ) ) + if ( isset( $assoc_args['activate'] ) ) { WP_CLI::run_command( array( 'plugin', 'activate', $plugin_slug ) ); + } } /** -- 2.11.0