-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Clean script: Use braces instead of @-pattern for glob #67833
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: 0 B Total Size: 1.83 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! I should have thoroughly tested all scripts 😥
I noticed that the fixtures:clean
command wasn't working properly either on Windows:
npm run fixtures:clean
> [email protected] fixtures:clean
> rimraf --glob 'test/integration/fixtures/blocks/*.+(json|serialized.html)'
'serialized.html)'' is not recognized as an internal or external command,
operable program or batch file.
I think this command isn't used in core so maybe we can address it in a follow-up, but will we fix it in this PR?
If the clean packages script is working then we can apply the same change to the fixtures clean script I think. I'll add that change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error no longer occurs, but it seems that the files are not deleted on Windows OS:
d950ab3cc15f78ffa2d3a0aaad139078.mp4
However, it works correctly on Linux. Therefore, if this PR is urgent, it may be better to merge this PR once and address the issue in a follow-up.
Therefore, I will approve this PR.
Thanks @t-hamano 😕 I will land this so that CI is not broken on the Core repo and we can address those problems in a follow-up. Maybe just using simpler patterns will work for fixtures: diff --git before/package.json after/package.json
index a0182e2e27..846fae9550 100644
--- before/package.json
+++ after/package.json
@@ -193,7 +193,7 @@
"docs:gen": "node ./docs/tool/index.js",
"docs:theme-ref": "node ./bin/api-docs/gen-theme-reference.mjs",
"env": "wp-env",
- "fixtures:clean": "rimraf --glob 'test/integration/fixtures/blocks/*.{json,serialized.html}'",
+ "fixtures:clean": "rimraf --glob 'test/integration/fixtures/blocks/*.json' 'test/integration/fixtures/blocks/*.serialized.html'",
"fixtures:generate": "cross-env GENERATE_MISSING_FIXTURES=y npm run test:unit test/integration/full-content/ && npm run format test/integration/fixtures/blocks/*.json",
"fixtures:regenerate": "npm-run-all fixtures:clean fixtures:generate",
"format": "wp-scripts format", (this works on macOS) |
What?
Try braces instead of @-pattern to fix a windows build issue:
I don't have a good setup to debug this, I have no good way of reproducing the issue or verifying the fix.
Follow-up to #67829.
Why?
Trying to get those windows build issues addressed.
How?
Try a different glob pattern to expand to the desired paths.
Testing Instructions
prints
prints