Skip to content

Commit

Permalink
build(updater): Refactor command output handling and add ai-commit ge…
Browse files Browse the repository at this point in the history
…nerators

- Update command output handling to trim unnecessary characters
- Add new generators for ai-commit: 'bito_cli', 'github_copilot_cli', and 'github_models_cli'
- Ensure no-verify options are available for each generator
- Improve clarity and functionality in composer.json
  • Loading branch information
guanguans committed Nov 8, 2024
1 parent 4c9ae01 commit a290fd4
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 108 deletions.
1 change: 1 addition & 0 deletions app/Music.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function search(string $keyword, array $sources = []): Collection
->collapse()
->pipe(fn (Collection $songs): Collection => $this->ensureWithUrls($songs))
->sortBy([
// ['name', \SORT_ASC],
['name', 'asc'],
['artist', 'asc'],
['size', 'desc'],
Expand Down
9 changes: 6 additions & 3 deletions composer-updater
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,12 @@ $status = (new SingleCommandApplication)
{
return array_reduce(
json_decode(
$this
->mustRunCommand("$this->highestComposerBinary outdated --format=json --direct --ansi")
->getOutput(),
substr(
$output = $this
->mustRunCommand("$this->highestComposerBinary outdated --format=json --direct --ansi")
->getOutput(),
strpos($output, '{')
),
true
)['installed'],
function (array $carry, array $package): array {
Expand Down
10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,14 @@
"@cghooks update"
],
"post-autoload-dump": [],
"ai-commit": "@php ./vendor/bin/ai-commit commit --generator=github_copilot_cli --ansi",
"ai-commit-no-verify": "@ai-commit --commit-options=--no-verify",
"ai-commit": "@php ./vendor/bin/ai-commit commit --ansi",
"ai-commit-bito": "@ai-commit --generator=bito_cli",
"ai-commit-bito-no-verify": "@ai-commit-bito --no-verify",
"ai-commit-github-copilot": "@ai-commit --generator=github_copilot_cli",
"ai-commit-github-copilot-no-verify": "@ai-commit-github-copilot --no-verify",
"ai-commit-github-models": "@ai-commit --generator=github_models_cli",
"ai-commit-github-models-no-verify": "@ai-commit-github-models --no-verify",
"ai-commit-no-verify": "@ai-commit --no-verify",
"benchmark": "@php ./vendor/bin/phpbench run --warmup=1 --retry-threshold=1 --iterations=3 --revs=5 --ansi -v",
"cghooks": "@php ./vendor/bin/cghooks --ansi -v",
"checks": [
Expand Down
Loading

0 comments on commit a290fd4

Please sign in to comment.