Skip to content

Commit ca310fb

Browse files
update
1 parent 8fc9016 commit ca310fb

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

src/Capsule/Artisan.php

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,35 @@ public static function call(string $input): int
7171
$args = array_slice($tokens, 1);
7272
$argv = array_merge(['tame'], [$command], $args);
7373

74-
require_once base_path('tame');
75-
74+
// Instantiate dispatcher and ensure default/internal commands are registered
7675
$artisan = new self();
7776

77+
$makeCmd = '\Tamedevelopers\Support\Commands\MakeCommand';
78+
$processorCmd = '\Tamedevelopers\Support\Commands\ProcessorCommand';
79+
80+
// Register built-in commands that are normally wired in the CLI entrypoint (idempotent)
81+
if (class_exists($makeCmd)) {
82+
if (!isset(self::$commands['make'])) {
83+
$makeCmd = new $makeCmd();
84+
[$signature, $description] = [
85+
$makeCmd->getSignatureName(), $makeCmd->description(),
86+
];
87+
$artisan->register($signature, $makeCmd, $description);
88+
}
89+
}
90+
if (class_exists($processorCmd)) {
91+
if (!isset(self::$commands['processor'])) {
92+
$processorCmd = new $processorCmd();
93+
[$signature, $description] = [
94+
$processorCmd->getSignatureName(), $processorCmd->description(),
95+
];
96+
$artisan->register($signature, $processorCmd, $description);
97+
}
98+
}
99+
100+
// register and discover other commands from other packages
101+
$artisan->discoverExternal();
102+
78103
return $artisan->run($argv);
79104
}
80105

src/Commands/ProcessorCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function toText(): string
100100
],
101101
]);
102102

103-
Logger::info("$text\n");
103+
// Logger::info("$text\n");
104104

105105
return $text;
106106
}

0 commit comments

Comments
 (0)