fix(commands): surface core fetch errors, run post-install in the project, exit 1 on invalid project command; document compat flow

This commit is contained in:
kj
2026-10-05 17:36:08 -03:00
parent eb5e6eeed4
commit 6925b814e6
6 changed files with 97 additions and 55 deletions
+4 -2
View File
@@ -28,7 +28,8 @@ if ($command === null || in_array($command, $toolboxCommands, true)) {
$coreCommand = 'Commands\\' . ucfirst($command);
if (!class_exists($coreCommand) && !file_exists(ROOT_CORE . '/Commands/' . ucfirst($command) . '.php')) {
exit("Invalid command.\n");
fwrite(STDERR, "Invalid command.\n");
exit(1);
}
$cli = new $coreCommand();
@@ -36,5 +37,6 @@ $cli = new $coreCommand();
if ($cli instanceof Interfaces\CommandInterface) {
call_user_func_array([$cli, 'run'], array_slice($argv, 2));
} else {
exit("Invalid command.\n");
fwrite(STDERR, "La clase $coreCommand no implementa CommandInterface.\n");
exit(1);
}