Title: Using globstar in glob pattern prevents dot (hidden) files from being matched · Issue #56321 · nodejs/node · GitHub
Open Graph Title: Using globstar in glob pattern prevents dot (hidden) files from being matched · Issue #56321 · nodejs/node
X Title: Using globstar in glob pattern prevents dot (hidden) files from being matched · Issue #56321 · nodejs/node
Description: Version v22.5.0 Platform Linux razerbook-og 6.11.7-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 8 19:07:28 UTC 2024 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? Create the following files to scan: scan/ subdir/ a.js...
Open Graph Description: Version v22.5.0 Platform Linux razerbook-og 6.11.7-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 8 19:07:28 UTC 2024 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? Create the fol...
X Description: Version v22.5.0 Platform Linux razerbook-og 6.11.7-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 8 19:07:28 UTC 2024 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? Create the fol...
Opengraph URL: https://github.com/nodejs/node/issues/56321
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Using globstar in glob pattern prevents dot (hidden) files from being matched","articleBody":"### Version\n\nv22.5.0\n\n### Platform\n\n```text\nLinux razerbook-og 6.11.7-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 8 19:07:28 UTC 2024 x86_64 GNU/Linux\n```\n\n### Subsystem\n\nfs\n\n### What steps will reproduce the bug?\n\nCreate the following files to scan:\n\n```\nscan/\n subdir/\n a.js\n .b.js\n```\n\nCreate the following script:\n\n```js\n'use strict'\n\nconst fsp = require('node:fs/promises')\n\n;(async () =\u003e {\n const globs = [\n 'scan/subdir/{.,}*.js',\n 'scan/*/{.,}*.js',\n 'scan/**/{.,}*.js',\n 'subdir/{.,}*.js',\n '*/{.,}*.js',\n '**/{.,}*.js',\n ]\n for (const glob of globs) {\n console.log('glob: ' + glob)\n if (glob.startsWith('subdir/')) process.chdir('scan')\n for await (const entry of fsp.glob(glob)) {\n console.dir(entry)\n }\n }\n})()\n```\n\nWhenever `**` is used in the pattern, the dot (hidden) files are not matched, even though the pattern specifically requests them.\n\n### How often does it reproduce? Is there a required condition?\n\nAlways reproducible as long as `**` is used in the pattern and the pattern is matching dot (hidden) files.\n\nIf the pattern is `*` or an explicit directory name, then the dot (hidden) files are matched. So this is specific to using globstar (`**`).\n\n### What is the expected behavior? Why is that the expected behavior?\n\nThe dot (hidden) files should be matched after the globstar because the pattern is specifically requesting them.\n\n### What do you see instead?\n\nWhen globstar is used in the pattern, the dot (hidden) files are not matched.\n\n### Additional information\n\nThe described scenario works as expected using node-glob and bash, so the behavior of the built-in function in Node.js is inconsistent.","author":{"url":"https://github.com/mojavelinux","@type":"Person","name":"mojavelinux"},"datePublished":"2024-12-19T21:00:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/56321/node/issues/56321"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:68bc0cc9-b57a-903b-0a2f-f840184c7442 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CDC0:1EFAA3:C73429:10CD318:6A4C56A1 |
| html-safe-nonce | ff7133906928ba90dca78e46bcb5a2276046167bb854271e055841ba04bc8233 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDREMwOjFFRkFBMzpDNzM0Mjk6MTBDRDMxODo2QTRDNTZBMSIsInZpc2l0b3JfaWQiOiI3NjAxNjYyMDMwNTYzMjY4MjU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1e289af906fac80c9c6f27e2daa4a8fefe5d1b969583f3158f4e5c122b98109e |
| hovercard-subject-tag | issue:2751412608 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/56321/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d2090240cc1710a233e4e7dd38c5ae9a99250c5dc996f3e146a9cf1c62ae583e/nodejs/node/issues/56321 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d2090240cc1710a233e4e7dd38c5ae9a99250c5dc996f3e146a9cf1c62ae583e/nodejs/node/issues/56321 |
| og:image:alt | Version v22.5.0 Platform Linux razerbook-og 6.11.7-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 8 19:07:28 UTC 2024 x86_64 GNU/Linux Subsystem fs What steps will reproduce the bug? Create the fol... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mojavelinux |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 14099438da5379150f15a2892474c7c7e6c0e55e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width