mirror of
https://github.com/Homebrew/brew.git
synced 2026-08-12 14:23:48 +04:00
Wrap stop hook lgtm output
- Keep Stop hook stdout valid JSON so Codex can parse it. - Move `./bin/brew lgtm` handling into a wrapper script.
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "./bin/brew lgtm >&2 && printf '{\"continue\":true}'",
|
||||
"command": ".codex/hooks/brew-lgtm-stop.sh",
|
||||
"timeout": 360
|
||||
}
|
||||
]
|
||||
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd "$(dirname "$0")/../.." || {
|
||||
printf '%s\n' '{"decision":"block","reason":"Failed to cd to the repository root before running ./bin/brew lgtm."}'
|
||||
exit 0
|
||||
}
|
||||
|
||||
if ./bin/brew lgtm >&2
|
||||
then
|
||||
printf '%s\n' '{"continue":true}'
|
||||
else
|
||||
printf '%s\n' '{"decision":"block","reason":"./bin/brew lgtm failed; review the output above and fix it before stopping."}'
|
||||
fi
|
||||
Reference in New Issue
Block a user