fix: ignore non-shebang gitbundle tool files
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user