Skip to content

Commit

Permalink
refactor: simplify glob
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyg603 committed Aug 8, 2024
1 parent 2674ceb commit f43d7a1
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/glob.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import { stat } from "node:fs/promises";
import { fileExists } from "./fs";
import { glob } from "glob";

export async function globFiles(pattern: string): Promise<string[]> {
const result = await glob(pattern);
const files = [] as string[];

for (const file of result) {
if (await fileExists(file) && !(await stat(file)).isDirectory()) {
files.push(file);
}
}

return files;
return glob(pattern, { nodir: true });
}

0 comments on commit f43d7a1

Please sign in to comment.