Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(scripts): skip deleted files in externalize-inline-tests

Steven Enamakel1a18b1deadf9
diff --git a/scripts/externalize-inline-tests.mjs b/scripts/externalize-inline-tests.mjs
index b7a41ee671..c1ead4f524 100644
--- a/scripts/externalize-inline-tests.mjs
+++ b/scripts/externalize-inline-tests.mjs
@@ -333,6 +333,7 @@ function run(roots, { write, fmt }) {
let moved = 0;
for (const rel of trackedRustFiles(root)) {
const file = path.join(root, rel);
+ if (!fs.existsSync(file)) continue; // deleted in the working tree, not yet staged
const src = fs.readFileSync(file, "utf8");
if (!/#\[cfg\([^\n]*\btest\b/.test(src) && !/\]\s*\n\s*(?:pub[^\n]*\s)?mod\s/.test(src)) continue;
const base = path.basename(file);