mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-04 09:13:08 +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
|
docker-compose.override.yml
|
||||||
.claude/docker-compose.override.yml
|
.claude/docker-compose.override.yml
|
||||||
|
.claude/hans/
|
||||||
|
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
yarn.lock
|
yarn.lock
|
||||||
10
dev.mjs
10
dev.mjs
@@ -117,7 +117,7 @@ async function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!processes.server) {
|
if (!processes.server) {
|
||||||
cleanup();
|
await cleanup();
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,9 +175,13 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run main function
|
// Run main function
|
||||||
main().catch((err) => {
|
main().catch(async (err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const cleanup = createCleanupHandler(processes);
|
const cleanup = createCleanupHandler(processes);
|
||||||
cleanup();
|
try {
|
||||||
|
await cleanup();
|
||||||
|
} catch (cleanupErr) {
|
||||||
|
console.error('Cleanup error:', cleanupErr);
|
||||||
|
}
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -28,7 +28,7 @@
|
|||||||
},
|
},
|
||||||
"apps/server": {
|
"apps/server": {
|
||||||
"name": "@automaker/server",
|
"name": "@automaker/server",
|
||||||
"version": "0.7.1",
|
"version": "0.7.3",
|
||||||
"license": "SEE LICENSE IN LICENSE",
|
"license": "SEE LICENSE IN LICENSE",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/claude-agent-sdk": "0.1.76",
|
"@anthropic-ai/claude-agent-sdk": "0.1.76",
|
||||||
@@ -78,7 +78,7 @@
|
|||||||
},
|
},
|
||||||
"apps/ui": {
|
"apps/ui": {
|
||||||
"name": "@automaker/ui",
|
"name": "@automaker/ui",
|
||||||
"version": "0.7.1",
|
"version": "0.7.3",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "SEE LICENSE IN LICENSE",
|
"license": "SEE LICENSE IN LICENSE",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -610,6 +610,25 @@ export async function startServerAndWait({ serverPort, corsOriginEnv, npmArgs, c
|
|||||||
if (!serverReady) {
|
if (!serverReady) {
|
||||||
log('Error: Server failed to start', 'red');
|
log('Error: Server failed to start', 'red');
|
||||||
console.log('Check logs/server.log for details');
|
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;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
start.mjs
10
start.mjs
@@ -161,7 +161,7 @@ async function main() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!processes.server) {
|
if (!processes.server) {
|
||||||
cleanup();
|
await cleanup();
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,9 +256,13 @@ async function main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run main function
|
// Run main function
|
||||||
main().catch((err) => {
|
main().catch(async (err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
const cleanup = createCleanupHandler(processes);
|
const cleanup = createCleanupHandler(processes);
|
||||||
cleanup();
|
try {
|
||||||
|
await cleanup();
|
||||||
|
} catch (cleanupErr) {
|
||||||
|
console.error('Cleanup error:', cleanupErr);
|
||||||
|
}
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user