mirror of
https://github.com/JimLiu/baoyu-skills.git
synced 2026-07-31 14:19:47 +08:00
refactor(baoyu-post-to-weibo): add entry point guard to md-to-html.ts
This commit is contained in:
@@ -446,7 +446,9 @@ Options:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await main().catch((err) => {
|
if (import.meta.main ?? (process.argv[1] && path.resolve(process.argv[1]) === path.resolve(import.meta.filename ?? ''))) {
|
||||||
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
|
await main().catch((err) => {
|
||||||
process.exit(1);
|
console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
|
||||||
});
|
process.exit(1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user