mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
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:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -81,6 +81,7 @@ blob-report/
|
||||
|
||||
docker-compose.override.yml
|
||||
.claude/docker-compose.override.yml
|
||||
.claude/hans/
|
||||
|
||||
pnpm-lock.yaml
|
||||
yarn.lock
|
||||
10
dev.mjs
10
dev.mjs
@@ -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);
|
||||
});
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -28,7 +28,7 @@
|
||||
},
|
||||
"apps/server": {
|
||||
"name": "@automaker/server",
|
||||
"version": "0.7.1",
|
||||
"version": "0.7.3",
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/claude-agent-sdk": "0.1.76",
|
||||
@@ -78,7 +78,7 @@
|
||||
},
|
||||
"apps/ui": {
|
||||
"name": "@automaker/ui",
|
||||
"version": "0.7.1",
|
||||
"version": "0.7.3",
|
||||
"hasInstallScript": true,
|
||||
"license": "SEE LICENSE IN LICENSE",
|
||||
"dependencies": {
|
||||
|
||||
@@ -610,6 +610,25 @@ export async function startServerAndWait({ serverPort, corsOriginEnv, npmArgs, c
|
||||
if (!serverReady) {
|
||||
log('Error: Server failed to start', 'red');
|
||||
console.log('Check logs/server.log for details');
|
||||
|
||||
// Clean up the spawned server process that failed health check
|
||||
if (serverProcess && !serverProcess.killed && serverProcess.pid) {
|
||||
log('Terminating failed server process...', 'yellow');
|
||||
try {
|
||||
await killProcessTree(serverProcess.pid);
|
||||
} catch (killErr) {
|
||||
// Fallback: try direct kill if tree-kill fails
|
||||
try {
|
||||
serverProcess.kill('SIGKILL');
|
||||
} catch {
|
||||
// Process may have already exited
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Close the log stream
|
||||
logStream.end();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
10
start.mjs
10
start.mjs
@@ -161,7 +161,7 @@ async function main() {
|
||||
});
|
||||
|
||||
if (!processes.server) {
|
||||
cleanup();
|
||||
await cleanup();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -256,9 +256,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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user