Skip to content

Commit 37a2279

Browse files
committed
feat: prevent unexpected module import when reloading a command from both public and private folders
1 parent 4dec94c commit 37a2279

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/components/utils/cmd/loader.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ export default async function loader(file: string, customPath: string) {
6060
delete require.cache[resolvedPath];
6161
}
6262

63+
try {
64+
await fs.access(resolvedPath);
65+
} catch {
66+
return;
67+
}
68+
6369
const commandModule = await import(filePath);
6470

6571
if (

0 commit comments

Comments
 (0)