仅当存在与某个名称匹配的相邻文件时,才可以使用 glob 来选择文件

问题描述 投票:0回答:0

我认为答案是否定的——但基本上我们喜欢做类似

**/*.ts
的事情——但前提是没有相邻的
.js
文件。

所以给定一棵这样的树:

dirA
  foo.js
  foo.ts << Shouldn't match because of adjacent .js file
dirB
  bar.ts << Want to match only this

在这个例子中,我想找到一种只匹配

bar.ts
的方法。

我再次认为这是不可能的,但我想确定。

不幸的是,我们不能使用其他解决方法来实现这一点,包括 glob-select 语句的组合。

pattern-matching match glob
© www.soinside.com 2019 - 2024. All rights reserved.