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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user