fix: ignore non-shebang gitbundle tool files

This commit is contained in:
Codex
2026-06-08 11:39:34 +08:00
parent a5250d985d
commit 811b58b71c
3 changed files with 3 additions and 3 deletions
-1
View File
@@ -162,7 +162,6 @@ async function prepareGitBundleTools(workspacePath: string): Promise<{ binPath?:
const filePath = path.join(binPath, entry.name);
const text = await readFile(filePath, "utf8");
const firstLine = text.split(/\r?\n/u, 1)[0] ?? "";
if (entry.name.endsWith(".ts") && !firstLine.startsWith("#!")) throw new AgentRunError("schema-invalid", `gitbundle tool ${entry.name} must start with a shebang`, { httpStatus: 400 });
if (!firstLine.startsWith("#!")) continue;
await chmod(filePath, 0o755);
names.push(entry.name);