feat(gateway): improve Gateway process management & logging (#26)

This commit is contained in:
DigHuang
2026-02-09 22:14:56 -08:00
committed by GitHub
Unverified
parent 3379229914
commit a27f3b4113
5 changed files with 249 additions and 103 deletions

View File

@@ -98,9 +98,7 @@ export function getOpenClawEntryPath(): string {
export function isOpenClawPresent(): boolean {
const dir = getOpenClawDir();
const pkgJsonPath = join(dir, 'package.json');
const exists = existsSync(dir) && existsSync(pkgJsonPath);
logger.debug(`isOpenClawPresent: dir=${dir}, exists=${exists}`);
return exists;
return existsSync(dir) && existsSync(pkgJsonPath);
}
/**
@@ -109,12 +107,8 @@ export function isOpenClawPresent(): boolean {
*/
export function isOpenClawBuilt(): boolean {
const dir = getOpenClawDir();
// Check for dist/entry.js or just the dist directory with JS files
const entryPath = join(dir, 'dist', 'entry.js');
const distDir = join(dir, 'dist');
const hasEntry = existsSync(entryPath);
const hasDist = existsSync(distDir);
logger.debug(`isOpenClawBuilt: distDir=${distDir}, hasDist=${hasDist}, hasEntry=${hasEntry}`);
return hasDist;
}