Skip to content

Commit

Permalink
fixes #139 adding --woocommerce flag to scaffold _s command
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeProKid committed Jul 20, 2018
1 parent 659348f commit 26699cb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
13 changes: 13 additions & 0 deletions features/scaffold.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
7 changes: 7 additions & 0 deletions src/Scaffold_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 26699cb

Please sign in to comment.