first commit.

This commit is contained in:
kj
2026-10-05 15:08:39 -03:00
commit b7799f9fff
93 changed files with 8966 additions and 0 deletions
@@ -0,0 +1,37 @@
<?php
namespace Toolbox\Commands;
use Toolbox\Config;
use Toolbox\SelfUpdater;
use Toolbox\ToolboxException;
final class SelfUpdateCommand extends Command
{
public static function describe(): string
{
return 'Actualiza el instalador global (script/phar)';
}
public function run(array $args): int
{
$parsed = $this->parse($args);
$from = $this->option($parsed['options'], 'from', Config::updateUrl());
$target = $this->option($parsed['options'], 'target', Config::binPath());
$temp = $this->option($parsed['options'], 'temp', sys_get_temp_dir());
if ($from === null || $target === null) {
$this->console->error('Faltan --from o --target.');
return 1;
}
try {
(new SelfUpdater($this->console))->update($from, $target, $temp);
} catch (ToolboxException $e) {
$this->console->error($e->getMessage());
return 1;
}
return 0;
}
}