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

Solution

  • My current solution was to use a few patterns: