mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 04:51:36 +00:00
chore: Enable "curly" rule to avoid single-statement if confusion/errors.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user