给定目录结构:
a/
b/
_private/
notes.txt
c/
_3.txt
1.txt
2.txt
d/
4.txt
5.txt
如何编写选择以下路径的 glob 模式(与 npm 模块glob兼容)?
a/b/c/1.txt
a/b/c/2.txt
a/b/d/4.txt
a/b/5.txt
这是我尝试过的:
// Find matching file paths inside "a/b/"...
glob("a/b/[!_]**/[!_]*", (err, paths) => {
console.log(paths);
});
但这只会发出:
a/b/c/1.txt
a/b/c/2.txt
a/b/d/4.txt