Use a dynamic branch name in the README

This commit is contained in:
Daniel Bachhuber 2024-05-02 15:50:30 -07:00
parent b923d846aa
commit dd2ec1e783
3 changed files with 6 additions and 1 deletions

View file

@ -50,6 +50,10 @@ Feature: Scaffold a README.md file for an existing package
"""
*This README.md is generated dynamically from the project's codebase
"""
And the {PACKAGE_PATH}/local/wp-cli/default-readme/README.md file should contain:
"""
wp package install wp-cli/default-readme:dev-master
"""
When I run `wp package uninstall wp-cli/default-readme`
Then STDOUT should contain:
"""

View file

@ -259,6 +259,7 @@ EOT;
'package_short_name' => $bits[1],
'package_name_border' => str_pad( '', strlen( $composer_obj['name'] ), '=' ),
'package_description' => isset( $composer_obj['description'] ) ? $composer_obj['description'] : '',
'branch' => $branch,
'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',
'shields' => '',
'has_commands' => false,

View file

@ -9,5 +9,5 @@ wp package install {{package_name}}:@stable
To install the latest development version of this package, use the following command instead:
```bash
wp package install {{package_name}}:dev-master
wp package install {{package_name}}:dev-{{branch}}
```