Skip to content

Commit df25ae1

Browse files
Use a dynamic branch name in the README (#241)
1 parent b923d84 commit df25ae1

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

features/scaffold-package-readme.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ Feature: Scaffold a README.md file for an existing package
5050
"""
5151
*This README.md is generated dynamically from the project's codebase
5252
"""
53+
And the {PACKAGE_PATH}/local/wp-cli/default-readme/README.md file should contain:
54+
"""
55+
wp package install wp-cli/default-readme:dev-master
56+
"""
5357
When I run `wp package uninstall wp-cli/default-readme`
5458
Then STDOUT should contain:
5559
"""

src/ScaffoldPackageCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ public function package_readme( $args, $assoc_args ) {
259259
'package_short_name' => $bits[1],
260260
'package_name_border' => str_pad( '', strlen( $composer_obj['name'] ), '=' ),
261261
'package_description' => isset( $composer_obj['description'] ) ? $composer_obj['description'] : '',
262+
'branch' => $branch,
262263
'required_wp_cli_version' => ! empty( $composer_obj['require']['wp-cli/wp-cli'] ) ? str_replace( [ '~', '^', '>=' ], 'v', $composer_obj['require']['wp-cli/wp-cli'] ) : 'v1.3.0',
263264
'shields' => '',
264265
'has_commands' => false,

templates/readme-installing.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ wp package install {{package_name}}:@stable
99
To install the latest development version of this package, use the following command instead:
1010

1111
```bash
12-
wp package install {{package_name}}:dev-master
12+
wp package install {{package_name}}:dev-{{branch}}
1313
```

0 commit comments

Comments
 (0)