Skip to content

Commit d13d388

Browse files
committed
Fix remaining template issues
1 parent 7b23ef9 commit d13d388

File tree

3 files changed

+9
-26
lines changed

3 files changed

+9
-26
lines changed

src/ScaffoldPackageCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function package( $args, $assoc_args ) {
105105
$template_path = $package_root . '/templates/';
106106
$wp_cli_yml = <<<EOT
107107
require:
108-
- command.php
108+
- hello-world-command.php
109109
EOT;
110110

111111
$files_written = $this->create_files( array(

templates/HelloWorldCommand.mustache

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@ namespace WP_CLI\HelloWorld;
55
use WP_CLI;
66
use WP_CLI_Command;
77

8-
/**
9-
* Greets the world.
10-
*
11-
* ## EXAMPLES
12-
*
13-
* # Greet the world.
14-
* $ wp hello-world
15-
* Success: Hello World!
16-
*/
178
class HelloWorldCommand extends WP_CLI_Command {
189
1910
/**
20-
* Invoke the command.
11+
* Greets the world.
12+
*
13+
* ## EXAMPLES
14+
*
15+
* # Greet the world.
16+
* $ wp hello-world
17+
* Success: Hello World!
2118
*
2219
* @param array $args Indexed array of positional arguments.
2320
* @param array $assoc_args Associative array of associative arguments.
21+
*/
2422
public function __invoke( $args, $assoc_args ) {
2523
WP_CLI::success( 'Hello World!' );
2624
}

templates/hello-world-command.mustache

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,6 @@ if ( ! class_exists( '\WP_CLI' ) ) {
88
return;
99
}
1010

11-
/**
12-
* Says "Hello World" to new users
13-
*
14-
* @when before_wp_load
15-
*/
16-
$hello_world_command = function() {
17-
WP_CLI::success( "Hello world." );
18-
};
19-
WP_CLI::add_command( 'hello-world', $hello_world_command );
20-
<?php
21-
22-
if ( ! class_exists( 'WP_CLI' ) ) {
23-
return;
24-
}
25-
2611
$wpcli_hello_world_autoloader = __DIR__ . '/vendor/autoload.php';
2712

2813
if ( file_exists( $wpcli_hello_world_autoloader ) ) {

0 commit comments

Comments
 (0)