The open source coding agent.
TypeScript
fix: bash tool errors for chmod (#1502)
Aiden Cline4172e3ad2850
diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.tsindex 896ec79bf75..629201e37a9 100644--- a/packages/opencode/src/tool/bash.ts+++ b/packages/opencode/src/tool/bash.ts@@ -74,7 +74,7 @@ export const BashTool = Tool.define("bash", {// not an exhaustive list, but covers most common casesif (["cd", "rm", "cp", "mv", "mkdir", "touch", "chmod", "chown"].includes(command[0])) {for (const arg of command.slice(1)) {- if (arg.startsWith("-")) continue+ if (arg.startsWith("-") || (command[0] === "chmod" && arg.startsWith("+"))) continueconst resolved = await $`realpath ${arg}`.text().then((x) => x.trim())log.info("resolved path", { arg, resolved })if (!Filesystem.contains(app.path.cwd, resolved)) {