chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -20,13 +20,21 @@ async function prepareRoutedCommand(params: {
}
export async function tryRouteCli(argv: string[]): Promise<boolean> {
if (isTruthyEnvValue(process.env.OPENCLAW_DISABLE_ROUTE_FIRST)) return false;
if (hasHelpOrVersion(argv)) return false;
if (isTruthyEnvValue(process.env.OPENCLAW_DISABLE_ROUTE_FIRST)) {
return false;
}
if (hasHelpOrVersion(argv)) {
return false;
}
const path = getCommandPath(argv, 2);
if (!path[0]) return false;
if (!path[0]) {
return false;
}
const route = findRoutedCommand(path);
if (!route) return false;
if (!route) {
return false;
}
await prepareRoutedCommand({ argv, commandPath: path, loadPlugins: route.loadPlugins });
return route.run(argv);
}