Skip to content

Commit 149433e

Browse files
committed
Catch error in clean-tests-dir script
1 parent b5822c9 commit 149433e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/create-next-stack/src/tests/e2e/clean-tests-dir.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@ import path from "path"
88
"../../../../../../create-next-stack-tests"
99
)
1010

11-
if (!(await fs.stat(testsDirectory)).isDirectory()) {
11+
try {
12+
const stat = await fs.stat(testsDirectory)
13+
if (!stat.isDirectory()) {
14+
console.error(
15+
"Path lead to a file instead of a directory. Path:",
16+
testsDirectory
17+
)
18+
return
19+
}
20+
} catch (error) {
1221
console.log("Tests directory not found.")
1322
return
1423
}

0 commit comments

Comments
 (0)