The open source coding agent.
TypeScript
ci: fixes
Dax Raad9d30bc692cb8
diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.tsindex aa785235f1f..05f85b6b215 100644--- a/packages/opencode/src/config/config.ts+++ b/packages/opencode/src/config/config.ts@@ -138,6 +138,7 @@ export namespace Config {}async function installDependencies(dir: string) {+ if (Installation.isDev()) returnawait Bun.write(path.join(dir, "package.json"), "{}")await Bun.write(path.join(dir, ".gitignore"), ["node_modules", "package.json", "bun.lock", ".gitignore"].join("\n"))await BunProc.run(diff --git a/packages/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.tsindex fb49ae739e2..3cd464acfa0 100644--- a/packages/opencode/src/snapshot/index.ts+++ b/packages/opencode/src/snapshot/index.ts@@ -124,6 +124,7 @@ export namespace Snapshot {export async function diff(hash: string) {const git = gitdir()+ await $`git --git-dir ${git} add .`.quiet().cwd(Instance.directory).nothrow()const result = await $`git --git-dir=${git} diff ${hash} -- .`.quiet().cwd(Instance.worktree).nothrow()if (result.exitCode !== 0) {diff --git a/packages/opencode/test/snapshot/snapshot.test.ts b/packages/opencode/test/snapshot/snapshot.test.tsindex 0ffed351fb5..5f15b9b4e08 100644--- a/packages/opencode/test/snapshot/snapshot.test.ts+++ b/packages/opencode/test/snapshot/snapshot.test.ts@@ -502,9 +502,9 @@ test("diff function with various changes", async () => {await Bun.write(`${tmp.path}/b.txt`, "modified content")const diff = await Snapshot.diff(before!)- expect(diff).toContain("deleted")- expect(diff).toContain("modified")- // Note: git diff only shows changes to tracked files, not untracked files like new.txt+ expect(diff).toContain("a.txt")+ expect(diff).toContain("b.txt")+ expect(diff).toContain("new.txt")},})})