Skip to content

Commit

Permalink
Fixes #480
Browse files Browse the repository at this point in the history
Signed-off-by: Maxime Robert <maxime.robert@smile.fr>
  • Loading branch information
marob committed Oct 23, 2023
1 parent 5a00176 commit d1d6d14
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions analyzer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { parse } from "@babel/parser";
import traverse from "@babel/traverse";
import { join } from "node:path";
import { readdirSync, statSync, readFileSync } from "node:fs";
import { readdirSync, lstatSync, readFileSync } from "node:fs";
import { basename, resolve, isAbsolute, relative } from "node:path";

const IGNORE_DIRS = process.env.ASTGEN_IGNORE_DIRS
Expand Down Expand Up @@ -46,7 +46,11 @@ const getAllFiles = (dir, extn, files, result, regex) => {
continue;
}
const file = join(dir, files[i]);
if (statSync(file).isDirectory()) {
const fileStat = lstatSync(file);
if (fileStat.isSymbolicLink()) {
continue;
}
if (fileStat.isDirectory()) {
// Ignore directories
const dirName = basename(file);
if (
Expand Down

0 comments on commit d1d6d14

Please sign in to comment.