This commit is contained in:
garronej
2023-06-21 18:23:12 +02:00
parent 3e0a1721ce
commit 90d765d7f6
2 changed files with 14 additions and 18 deletions

View File

@ -1,15 +1,8 @@
import * as fs from "fs";
import * as path from "path";
export const crawlRec = (dir_path: string, paths: string[]) => {
let file_names: string[] = [];
try {
file_names = fs.readdirSync(dir_path);
} catch (e) {
// dir_path does not exist
return;
}
for (const file_name of file_names) {
const crawlRec = (dir_path: string, paths: string[]) => {
for (const file_name of fs.readdirSync(dir_path)) {
const file_path = path.join(dir_path, file_name);
if (fs.lstatSync(file_path).isDirectory()) {