Globbing ../**/*.js with cwd ./foo gives no results
Follow up to #117
I believe cwd is filtered out of results, rather than being a valid target for the results.
test('relative self (wildcard)', () => {
const files = globSync(['../**/*.txt'], { cwd: path.join(cwd, 'a') });
// Returns [ '../b/a.txt', '../b/b.txt' ]
// I believe it should return:
assert.deepEqual(files.sort(), [ '../a/a.txt', '../a/b.txt', '../b/a.txt', '../b/b.txt' ]);
});
Related: https://github.com/11ty/eleventy/issues/3854
i figured out about the existence of this issue last month when fixing #117 and how hard it might be to fix, and figured out it might be really hard to do with the current code structure. thankfully there's a somewhat big refactor i'm looking into making that in theory should solve this issue and greatly decrease the number of workarounds. meanwhile you might benefit from the cwd option to prevent it from using ../** as a pattern.
fwiw I did patch around this in Eleventy so for me that lowers the implied severity!
https://github.com/11ty/eleventy/issues/3854