Skip to content

Commit b5712ba

Browse files
committed
chore: update logic to skip invalid symlinks only
1 parent 6fbe22a commit b5712ba

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

templates/cli/lib/utils.js.twig

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,15 @@ function getAllFiles(folder) {
99
const files = [];
1010
for (const pathDir of fs.readdirSync(folder)) {
1111
const pathAbsolute = path.join(folder, pathDir);
12-
const stats = fs.lstatSync(pathAbsolute);
13-
if (stats.isDirectory() && !stats.isSymbolicLink()) {
12+
let stats;
13+
try {
14+
stats = fs.statSync(pathAbsolute);
15+
} catch (error) {
16+
continue;
17+
}
18+
if (stats.isDirectory()) {
1419
files.push(...getAllFiles(pathAbsolute));
15-
} else if (stats.isFile() && !stats.isSymbolicLink()) {
20+
} else {
1621
files.push(pathAbsolute);
1722
}
1823
}

0 commit comments

Comments
 (0)