feat: add generated scene skill platform hardening
This commit is contained in:
@@ -7,6 +7,20 @@ function resolveProjectRoot() {
|
||||
return path.resolve(envRoot);
|
||||
}
|
||||
|
||||
// Search for Cargo.toml to find the actual project root
|
||||
const candidates = [
|
||||
path.resolve(__dirname, "..", ".."), // claw-new (has Cargo.toml)
|
||||
path.resolve(__dirname, "..", "..", "..", "claw-new"), // sgClaw/claw-new
|
||||
path.resolve(__dirname, "..", "..", ".."), // sgClaw root
|
||||
];
|
||||
|
||||
for (const p of candidates) {
|
||||
if (fs.existsSync(path.join(p, "Cargo.toml"))) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback: directory containing sgclaw_config.json
|
||||
const configPath = resolveConfigPath();
|
||||
if (configPath && fs.existsSync(configPath)) {
|
||||
return path.dirname(configPath);
|
||||
|
||||
Reference in New Issue
Block a user