fix(setup): move OpenClaw detection into environment step

Avoids running `ls -d ~/.openclaw` as a separate Bash command which
triggers permission prompts for reading outside the project directory.
The environment step now reports OPENCLAW_PATH in its status block.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-04-16 14:14:25 +03:00
parent fdece8047e
commit 4ae9785a61
2 changed files with 10 additions and 7 deletions

View File

@@ -66,6 +66,13 @@ export async function run(_args: string[]): Promise<void> {
}
}
// Check for existing OpenClaw installation
const homedir = (await import('os')).homedir();
const openClawPath =
fs.existsSync(path.join(homedir, '.openclaw')) ? path.join(homedir, '.openclaw') :
fs.existsSync(path.join(homedir, '.clawdbot')) ? path.join(homedir, '.clawdbot') :
null;
log.info(
'Environment check complete',
{
@@ -76,6 +83,7 @@ export async function run(_args: string[]): Promise<void> {
hasEnv,
hasAuth,
hasRegisteredGroups,
openClawPath,
},
);
@@ -88,6 +96,7 @@ export async function run(_args: string[]): Promise<void> {
HAS_ENV: hasEnv,
HAS_AUTH: hasAuth,
HAS_REGISTERED_GROUPS: hasRegisteredGroups,
OPENCLAW_PATH: openClawPath ?? 'none',
STATUS: 'success',
LOG: 'logs/setup.log',
});