Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(shared): command output failure scan rejects clean output in one pass #26935

Mergedhieu-lee(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/26935/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 14 additions and 6 deletions.

x
0 of 2 viewed, 2 left
4 additions and 0 deletionspackages/shared/src/toolOutput.test.tsModified
View file
@@ -156,6 +156,7 @@
"<exited with exit code 2>",
"Exited with exit code 1",
"exit code: 127",
+ "clean exit first, then ExIt CoDe: 3",
expect(toolOutputIndicatesFailure(text)).toBe(true);
});
@@ -167,6 +168,9 @@
"Exited with exit code 0",
"cannot find path",
"is not recognized",
+ "exit",
+ "not found",
+ "the path cannot be found",
]) {
expect(toolOutputIndicatesFailure(text)).toBe(false);
10 additions and 6 deletionspackages/shared/src/toolOutput.tsModified
View file
@@ -232,17 +232,21 @@
: undefined;
​
+// A superset of every needle below, so most outputs are rejected by this single scan.
+const FAILURE_HINT =
+ /enoent|no such|no files found|not found|commandnotfound|not recognized|cannot (?:find path|be found)|exit/i;