Skip to content

Commit bec20a5

Browse files
committed
Add missing file
1 parent a9bd5db commit bec20a5

File tree

3 files changed

+35
-7
lines changed

3 files changed

+35
-7
lines changed

src/ScaffoldPackageCommand.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ public function package( $args, $assoc_args ) {
109109
EOT;
110110

111111
$files_written = $this->create_files( array(
112-
"{$package_dir}/.gitignore" => file_get_contents( "{$package_root}/.gitignore" ),
113-
"{$package_dir}/.editorconfig" => file_get_contents( "{$package_root}/.editorconfig" ),
114-
"{$package_dir}/.distignore" => file_get_contents( "{$package_root}/.distignore" ),
115-
"{$package_dir}/CONTRIBUTING.md" => file_get_contents( "{$package_root}/CONTRIBUTING.md" ),
116-
"{$package_dir}/wp-cli.yml" => $wp_cli_yml,
117-
"{$package_dir}/hello-world-command.php" => Utils\mustache_render( "{$template_path}/command.mustache", $assoc_args ),
118-
"{$package_dir}/composer.json" => Utils\mustache_render( "{$template_path}/composer.mustache", $assoc_args ),
112+
"{$package_dir}/.gitignore" => file_get_contents( "{$package_root}/.gitignore" ),
113+
"{$package_dir}/.editorconfig" => file_get_contents( "{$package_root}/.editorconfig" ),
114+
"{$package_dir}/.distignore" => file_get_contents( "{$package_root}/.distignore" ),
115+
"{$package_dir}/CONTRIBUTING.md" => file_get_contents( "{$package_root}/CONTRIBUTING.md" ),
116+
"{$package_dir}/wp-cli.yml" => $wp_cli_yml,
117+
"{$package_dir}/hello-world-command.php" => Utils\mustache_render( "{$template_path}/hello-world-command.mustache", $assoc_args ),
118+
"{$package_dir}/src/HelloWorldCommand.php" => Utils\mustache_render( "{$template_path}/HelloWorldCommand.mustache", $assoc_args ),
119+
"{$package_dir}/composer.json" => Utils\mustache_render( "{$template_path}/composer.mustache", $assoc_args ),
119120
), $force );
120121

121122
if ( empty( $files_written ) ) {

templates/HelloWorldCommand.mustache

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace WP_CLI\HelloWorld;
4+
5+
use WP_CLI;
6+
use WP_CLI_Command;
7+
8+
/**
9+
* Greets the world.
10+
*
11+
* ## EXAMPLES
12+
*
13+
* # Greet the world.
14+
* $ wp hello-world
15+
* Success: Hello World!
16+
*/
17+
class HelloWorldCommand extends WP_CLI_Command {
18+
19+
/**
20+
* Invoke the command.
21+
*
22+
* @param array $args Indexed array of positional arguments.
23+
* @param array $assoc_args Associative array of associative arguments.
24+
public function __invoke( $args, $assoc_args ) {
25+
WP_CLI::success( 'Hello World!' );
26+
}
27+
}
File renamed without changes.

0 commit comments

Comments
 (0)