action update module add

This commit is contained in:
2024-10-10 11:19:51 +03:00
parent f8e02dc19c
commit e29108f21d
4 changed files with 62 additions and 0 deletions

View File

@ -64,4 +64,18 @@ class ModuleController extends ConsoleController
}
}
/**
* @throws \Exception
*/
public function actionUpdateModule(): void
{
if (!isset($this->argv['path'])) {
throw new \Exception('Missing module path "--path" specified');
}
if (file_exists(ROOT_DIR . $this->argv['path'])) {
$moduleService = new ModuleService();
$moduleService->updateModule($this->argv['path']);
}
}
}

View File

@ -25,5 +25,6 @@ App::$collector->group(["prefix" => "module"], callback: function (RouteCollecto
App::$collector->console('install', [\kernel\console\controllers\ModuleController::class, 'actionInstallModule']);
App::$collector->console('uninstall', [\kernel\console\controllers\ModuleController::class, 'actionUninstallModule']);
App::$collector->console('pack', [\kernel\console\controllers\ModuleController::class, 'actionPackModule']);
App::$collector->console('update', [\kernel\console\controllers\ModuleController::class, 'actionUpdateModule']);
});