|
2 | 2 |
|
3 | 3 | const gracefulFs = require('graceful-fs'); |
4 | 4 | const fs = require('fs'); |
5 | | -const glob = require('glob'); |
| 5 | +const { globSync } = require('tinyglobby'); |
6 | 6 | const path = require('path'); |
7 | 7 | const Parser = require('./Parser'); |
8 | 8 | const Project = require('./Project'); |
@@ -74,29 +74,27 @@ function resolveCliArgGlob( |
74 | 74 | ? globRelativeToProjectRoot.replace(/\\/g, '/') |
75 | 75 | : globRelativeToProjectRoot; |
76 | 76 |
|
77 | | - return glob |
78 | | - .sync(pattern, { |
79 | | - cwd: projectRootDir, |
80 | | - nocase: true, |
81 | | - absolute: true, |
82 | | - ignore: ignoredDirsGlobs, |
83 | | - // Match directories as well and mark them with a trailing slash. |
84 | | - nodir: false, |
85 | | - mark: true, |
86 | | - }) |
87 | | - .flatMap((filePath) => |
88 | | - filePath.endsWith('/') ? findAllElmFilesInDir(filePath) : filePath |
89 | | - ); |
| 77 | + return globSync(pattern, { |
| 78 | + cwd: projectRootDir, |
| 79 | + caseSensitiveMatch: false, |
| 80 | + absolute: true, |
| 81 | + ignore: ignoredDirsGlobs, |
| 82 | + // Match directories as well |
| 83 | + onlyFiles: false |
| 84 | + }).flatMap((filePath) => |
| 85 | + // Directories have their path end with `/` |
| 86 | + filePath.endsWith('/') ? findAllElmFilesInDir(filePath) : filePath |
| 87 | + ); |
90 | 88 | } |
91 | 89 |
|
92 | 90 | // Recursively search for *.elm files. |
93 | 91 | function findAllElmFilesInDir(dir /*: string */) /*: Array<string> */ { |
94 | | - return glob.sync('**/*.elm', { |
| 92 | + return globSync('**/*.elm', { |
95 | 93 | cwd: dir, |
96 | | - nocase: true, |
| 94 | + caseSensitiveMatch: false, |
97 | 95 | absolute: true, |
98 | 96 | ignore: ignoredDirsGlobs, |
99 | | - nodir: true, |
| 97 | + onlyFiles: true, |
100 | 98 | }); |
101 | 99 | } |
102 | 100 |
|
|
0 commit comments