minimatch - Matching all files without an extension, excluding folders [Minimatch]
问题描述
Using minimatch I can get all the files with the following pattern !*.*
but it also matches folder and no longer matches correctly within folders.
I'm testing the patterns here => http://pthrasher.github.io/minimatch-test/
With the following data
404
404.html
index
index.html
apples/
apples/a
apples/a.html
apples/b
apples/b.html
oranges/
oranges/c
oranges/c.html
oranges/d
oranges/d.html
Expected outcome would be
404
index
apples/a
apples/b
oranges/c
oranges/d
解决方案
My current solution was to use a few patterns:
- one for the
"index"
- one for the
"404"
- one for any files without extensions within folders
"*/!(*.*)"
推荐阅读
- bash - 在unix中固定..由于不止一个管道,我遇到了问题
- python - 有没有一种方法/方式可以按照要求将文本数据保存到具有正确格式的 csv 列中?
- asp.net - 如何使用 Httpclientfactory Typed 客户端调用装饰有 ValidateAntiForgeryToken 的服务器 api?
- python - 使用数据框作为日期模型计算 3D 数组的每日平均值
- flutter - Flutter中有没有办法通过滑动逐渐导航到页面
- javascript - 检测并转移从 Inspector 注入的 Javascript
- postback - Grid 中的 ImageButton 不会触发回发,因此不会触发 rowcommand
- python - 使用 deepstack 构建用于图像二元分类的集成学习模型
- sql-server - EF Core 仅查询 DateTimeOffset 的 DateTime 无法翻译;
- python - 用于运行 Python 的 py.exe 的替代程序