Files
breadcrumb-the-shire/core/Console/Commands/Module/AssetsSyncCommand.php

36 lines
914 B
PHP
Raw Normal View History

2026-03-19 19:04:28 +01:00
<?php
namespace MintyPHP\Console\Commands\Module;
final class AssetsSyncCommand extends AbstractModuleCommand
2026-03-19 19:04:28 +01:00
{
public function name(): string
{
return 'module:assets-sync';
}
public function description(): string
{
return 'Publish module web assets to web/modules/';
}
public function execute(array $args, array $options): int
{
$result = $this->moduleRunner()->assetsSync();
fwrite(STDOUT, sprintf(
"module-assets-sync: mode=%s created=%d updated=%d removed=%d unchanged=%d\n",
$result['mode'],
$result['created'],
$result['updated'],
$result['removed'],
$result['unchanged']
));
if ($result['message'] !== 'module-assets-sync: ok') {
fwrite(STDOUT, $result['message'] . PHP_EOL);
}
2026-03-19 19:04:28 +01:00
return (int) $result['exit_code'];
2026-03-19 19:04:28 +01:00
}
}