Skip to content

Commit 5c69cae

Browse files
fix: updated run
1 parent b6441dd commit 5c69cae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

create-db/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ export async function main() {
820820
}
821821
}
822822

823-
// Only run main() if this file is being executed directly, not when imported
824-
if (import.meta.url === `file://${process.argv[1]}`) {
825-
main();
823+
// Run main() if this file is being executed directly
824+
if (import.meta.url.endsWith('/index.js') || process.argv[1] === import.meta.url.replace('file://', '')) {
825+
main().catch(console.error);
826826
}

0 commit comments

Comments
 (0)