From 26699cbccf59e905940ed608685228143c6ecd63 Mon Sep 17 00:00:00 2001 From: CodeProKid Date: Thu, 19 Jul 2018 23:28:09 -0600 Subject: [PATCH 1/3] fixes #139 adding --woocommerce flag to scaffold _s command --- features/scaffold.feature | 13 +++++++++++++ src/Scaffold_Command.php | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/features/scaffold.feature b/features/scaffold.feature index d170ead74..f4b2006aa 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -350,6 +350,19 @@ Feature: WordPress code scaffolding """ And the {THEME_DIR}/starter-theme/sass directory should exist + Scenario: Scaffold starter code for a WooCommerce theme + Given a WP install + Given I run `wp theme path` + And save STDOUT as {THEME_DIR} + + When I run `wp scaffold _s starter-theme --woocommerce + Then STDOUT should contain: + """ + Success: Created theme 'Starter-theme'. + """ + And the {THEME_DIR}/starter-theme/woocommerce.css file should exist + And the {THEME_DIR}/starter-theme/inc/woocommerce.php file should exist + Scenario: Scaffold starter code for a theme and activate it Given a WP install When I run `wp scaffold _s starter-theme --activate` diff --git a/src/Scaffold_Command.php b/src/Scaffold_Command.php index 95326166b..3b922b946 100644 --- a/src/Scaffold_Command.php +++ b/src/Scaffold_Command.php @@ -339,6 +339,9 @@ public function block( $args, $assoc_args ) { * [--sassify] * : Include stylesheets as SASS. * + * [--woocommerce] + * : Include WooCommerce boilerplate files + * * [--force] * : Overwrite files that already exist. * @@ -392,6 +395,10 @@ public function _s( $args, $assoc_args ) { $body['underscoresme_sass'] = 1; } + if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'woocommerce' ) ) { + $body['underscoresme_woocommerce'] = 1; + } + $tmpfname = wp_tempnam( $url ); $response = wp_remote_post( $url, array( 'timeout' => $timeout, From d3112e0a57c58a4064edb77cc531209a3022c648 Mon Sep 17 00:00:00 2001 From: CodeProKid Date: Thu, 19 Jul 2018 23:30:55 -0600 Subject: [PATCH 2/3] #139 adding missing character in test --- features/scaffold.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/scaffold.feature b/features/scaffold.feature index f4b2006aa..5afae10f0 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -355,7 +355,7 @@ Feature: WordPress code scaffolding Given I run `wp theme path` And save STDOUT as {THEME_DIR} - When I run `wp scaffold _s starter-theme --woocommerce + When I run `wp scaffold _s starter-theme --woocommerce` Then STDOUT should contain: """ Success: Created theme 'Starter-theme'. From e3015e197089290f117c11952369d2e99b1da938 Mon Sep 17 00:00:00 2001 From: CodeProKid Date: Fri, 20 Jul 2018 00:29:12 -0600 Subject: [PATCH 3/3] #50 adding missing period in comment --- src/Scaffold_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Scaffold_Command.php b/src/Scaffold_Command.php index 3b922b946..8c324e351 100644 --- a/src/Scaffold_Command.php +++ b/src/Scaffold_Command.php @@ -340,7 +340,7 @@ public function block( $args, $assoc_args ) { * : Include stylesheets as SASS. * * [--woocommerce] - * : Include WooCommerce boilerplate files + * : Include WooCommerce boilerplate files. * * [--force] * : Overwrite files that already exist.