chore: update .gitignore and improve cleanup handling in scripts

- Added .claude/hans/ to .gitignore to prevent tracking of specific directory.
- Updated cleanup calls in dev.mjs and start.mjs to use await for proper asynchronous handling.
- Enhanced error handling during cleanup in case of failures.
- Improved server failure handling in startServerAndWait function to ensure proper termination of failed processes.
This commit is contained in:
webdevcody
2026-01-03 23:36:22 -05:00
parent afb0937cb3
commit 586aabe11f
5 changed files with 36 additions and 8 deletions

10
dev.mjs
View File

@@ -117,7 +117,7 @@ async function main() {
});
if (!processes.server) {
cleanup();
await cleanup();
process.exit(1);
}
@@ -175,9 +175,13 @@ async function main() {
}
// Run main function
main().catch((err) => {
main().catch(async (err) => {
console.error(err);
const cleanup = createCleanupHandler(processes);
cleanup();
try {
await cleanup();
} catch (cleanupErr) {
console.error('Cleanup error:', cleanupErr);
}
process.exit(1);
});