mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-11 22:53:04 +00:00
fix: correct regex anchors and align npx timeout in hook scripts
- Change \brg$ and \bgrep$ to \brg\b and \bgrep\b so full paths like /usr/bin/rg are matched correctly (all 3 hook variants) - Reduce npx fallback timeout from 15s to 8s to fit within the 10s hook runner timeout (Factory plugin)
This commit is contained in:
parent
455a75bce7
commit
ef12f9811d
3 changed files with 4 additions and 4 deletions
|
|
@ -69,7 +69,7 @@ function extractPattern(toolName, toolInput) {
|
|||
for (const token of tokens) {
|
||||
if (skipNext) { skipNext = false; continue; }
|
||||
if (!foundCmd) {
|
||||
if (/\brg$|\bgrep$/.test(token)) foundCmd = true;
|
||||
if (/\brg\b|\bgrep\b/.test(token)) foundCmd = true;
|
||||
continue;
|
||||
}
|
||||
if (token.startsWith('-')) {
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ function extractPattern(toolName, toolInput) {
|
|||
for (const token of tokens) {
|
||||
if (skipNext) { skipNext = false; continue; }
|
||||
if (!foundCmd) {
|
||||
if (/\brg$|\bgrep$/.test(token)) foundCmd = true;
|
||||
if (/\brg\b|\bgrep\b/.test(token)) foundCmd = true;
|
||||
continue;
|
||||
}
|
||||
if (token.startsWith('-')) {
|
||||
|
|
@ -122,7 +122,7 @@ function main() {
|
|||
const child = spawnSync(
|
||||
'npx',
|
||||
['-y', 'gitnexus', 'augment', pattern],
|
||||
{ encoding: 'utf-8', timeout: 15000, cwd, stdio: ['pipe', 'pipe', 'pipe'], shell: isWin }
|
||||
{ encoding: 'utf-8', timeout: 8000, cwd, stdio: ['pipe', 'pipe', 'pipe'], shell: isWin }
|
||||
);
|
||||
if (child.status === 0 && child.stderr && child.stderr.trim()) {
|
||||
result = child.stderr;
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ function extractPattern(toolName, toolInput) {
|
|||
for (const token of tokens) {
|
||||
if (skipNext) { skipNext = false; continue; }
|
||||
if (!foundCmd) {
|
||||
if (/\brg$|\bgrep$/.test(token)) foundCmd = true;
|
||||
if (/\brg\b|\bgrep\b/.test(token)) foundCmd = true;
|
||||
continue;
|
||||
}
|
||||
if (token.startsWith('-')) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue