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

Investigate include/exclude oddities #175

Merged
merged 10 commits into from Aug 13, 2019
Merged

Conversation

swissspidy
Copy link
Member

I've tried replicating #172 with the similar setup:

- test.php
- vendor/
- vendor/test.php

I ran:

vendor/bin/wp i18n make-pot /tmp/wp-i18n-test --debug --include=/vendor/test.php

And the vendor/test.php file was not included as expected.

Then I added 763941a and the file was now included as expected.

However, I failed at verifying this with a PHPUnit test.

@schlessera
Copy link
Member

I looked into the tests, and for the failing test, the function to extract the files returns an empty array. I'll take a closer look at the code now.

@schlessera
Copy link
Member

From what I can see on my system, this change does nothing, the strings that get passed into that method never contain a leading slash for the tests you are doing...

@schlessera
Copy link
Member

@swissspidy Can you take a look at the code change I made to validate?

What I found is that the logic that was in place include directories that had files that might match ... but excluded the actual files that would have matched.

@schlessera
Copy link
Member

Okay, it's obviously not enough to have the unit tests pass...

@schlessera schlessera added this to the 2.2.0 milestone Aug 13, 2019
@schlessera schlessera merged commit 379d2b0 into master Aug 13, 2019
@delete-merged-branch delete-merged-branch bot deleted the try/172-exclude-include branch August 13, 2019 16:32
@BartvanS
Copy link

I updated my wp-cli and wp cli i18n. Sadly if i recreate this scenario i still only get the translations from the test.php and not the vendor/test.php.
$ wp cli version -> 2.3.0
I installed the latest version of wp i18n with:
$ wp package install git@github.com:wp-cli/i18n-command.git

@swissspidy
Copy link
Member Author

@BartvanS What command are you running?

@BartvanS
Copy link

BartvanS commented Aug 19, 2019

wp i18n make-pot ./ ./test.pot --ignore-domain --include=/vendor/test.php

@schlessera
Copy link
Member

@BartvanS Do you maybe have the wp-cli/i18n-command package installed as an external package as well? You can check this via wp package list.

schlessera added a commit that referenced this pull request Jan 6, 2022
Investigate include/exclude oddities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants