Skip to content

Commit

Permalink
Merge pull request #159 from CodeProKid/feature/139
Browse files Browse the repository at this point in the history
fixes #139 adding --woocommerce flag to scaffold _s command
  • Loading branch information
schlessera authored Jul 20, 2018
2 parents e0e6a83 + e3015e1 commit e5cb0a8
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 @@ -355,6 +355,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 @@ -340,6 +340,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 @@ -393,6 +396,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 e5cb0a8

Please sign in to comment.