| 420 | } |
| 421 | |
| 422 | async function globFiles(pattern: string): Promise<string[]> { |
| 423 | const globber = await glob.create(pattern, { |
| 424 | followSymbolicLinks: false, |
| 425 | }); |
| 426 | // fs.stat resolve the symbolic link and returns stat for the |
| 427 | // file it pointed to, so isFile would make sure the resolved |
| 428 | // file is actually a regular file. |
| 429 | const files = []; |
| 430 | for (const file of await globber.glob()) { |
| 431 | const stats = await fs.stat(file); |
| 432 | if (stats.isFile()) { |
| 433 | files.push(file); |
| 434 | } |
| 435 | } |
| 436 | return files; |
| 437 | } |
| 438 | |
| 439 | function sort_and_uniq(a: string[]) { |
| 440 | return a |