Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relative paths for file header references #384

Merged
merged 3 commits into from
Feb 13, 2024
Merged

Conversation

jkrrv
Copy link
Contributor

@jkrrv jkrrv commented Feb 13, 2024

Resolves #383

@jkrrv jkrrv marked this pull request as ready for review February 13, 2024 05:22
@jkrrv jkrrv requested a review from a team as a code owner February 13, 2024 05:22
@swissspidy swissspidy changed the title Update MakePotCommand.php Use relative paths for file header references Feb 13, 2024
@swissspidy
Copy link
Member

Thanks for the fix!

Not sure why the test didn't catch this:

Scenario: Adds file references for file headers.
Given an empty foo-plugin directory
And a foo-plugin/foo-plugin.php file:
"""
<?php
/**
* Plugin Name: Foo Plugin
* Plugin URI: https://example.com
* Description: Plugin Description
* Version: 0.1.0
* Author:
* Author URI:
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: foo-plugin
* Domain Path: /languages
*/
"""
When I try `wp i18n make-pot foo-plugin foo-plugin.pot`
Then the foo-plugin.pot file should exist
And the foo-plugin.pot file should contain:
"""
Description of the plugin
"""
And the foo-plugin.pot file should contain:
"""
#: foo-plugin.php
"""
And the foo-plugin.pot file should contain:
"""
Plugin Description
"""

src/MakePotCommand.php Outdated Show resolved Hide resolved
Co-authored-by: Pascal Birchler <[email protected]>
@jkrrv
Copy link
Contributor Author

jkrrv commented Feb 13, 2024

Awesome. Thanks for the speedy response.

@swissspidy swissspidy added this to the 2.6.1 milestone Feb 13, 2024
@swissspidy swissspidy enabled auto-merge February 13, 2024 13:37
@swissspidy swissspidy merged commit c251a9c into wp-cli:main Feb 13, 2024
8 checks passed
saas786 added a commit to saas786/i18n-command that referenced this pull request May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Are file references for plugin/theme headers supposed to be absolute paths?
2 participants