Skip to content

Commit fda542e

Browse files
committed
fix(generator): use configured path for bito command
- The BitoGenerator was not using the configured path for the bito command. - Updated the generator to use the configured path if available.
1 parent e70eeda commit fda542e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

app/Generators/BitoGenerator.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ public function generate(string $prompt): string
4444
{
4545
file_put_contents($promptFile = ConfigManager::globalPath($this->config['prompt_filename']), $prompt);
4646

47-
return resolve(Process::class, ['command' => ['bito', '-p', $promptFile]] + $this->config['parameters'])
48-
->mustRun(function (string $type, string $data): void {
49-
Process::OUT === $type ? $this->output->write($data) : $this->output->write("<fg=red>$data</>");
50-
})
51-
->getOutput();
47+
return resolve(
48+
Process::class,
49+
['command' => [$this->config['path'] ?: 'bito', '-p', $promptFile]] + $this->config['parameters']
50+
)->mustRun(function (string $type, string $data): void {
51+
Process::OUT === $type ? $this->output->write($data) : $this->output->write("<fg=red>$data</>");
52+
})->getOutput();
5253
}
5354
}

config/ai-commit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@
101101
],
102102
'bito' => [
103103
'driver' => 'bito',
104+
'path' => null,
104105
'prompt_filename' => 'bito.prompt',
105106
'parameters' => [
106107
'cwd' => null,

0 commit comments

Comments
 (0)