fix(opencode): use correct global config path ~/.config/opencode (#117)
The OpenCode installer was writing to ~/.opencode but OpenCode expects global configuration at ~/.config/opencode per XDG Base Directory spec. Fixes: - src/commands/install.ts: Change default output from ~/.opencode to ~/.config/opencode - src/targets/opencode.ts: Recognize "opencode" basename (not just ".opencode") for direct writes without nesting Closes #114 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -63,7 +63,7 @@ describe("CLI", () => {
|
||||
expect(await exists(path.join(tempRoot, ".opencode", "plugins", "converted-hooks.ts"))).toBe(true)
|
||||
})
|
||||
|
||||
test("install defaults output to ~/.opencode", async () => {
|
||||
test("install defaults output to ~/.config/opencode", async () => {
|
||||
const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "cli-local-default-"))
|
||||
const fixtureRoot = path.join(import.meta.dir, "fixtures", "sample-plugin")
|
||||
|
||||
@@ -95,8 +95,9 @@ describe("CLI", () => {
|
||||
}
|
||||
|
||||
expect(stdout).toContain("Installed compound-engineering")
|
||||
expect(await exists(path.join(tempRoot, ".opencode", "opencode.json"))).toBe(true)
|
||||
expect(await exists(path.join(tempRoot, ".opencode", "agents", "repo-research-analyst.md"))).toBe(true)
|
||||
// OpenCode global config lives at ~/.config/opencode per XDG spec
|
||||
expect(await exists(path.join(tempRoot, ".config", "opencode", "opencode.json"))).toBe(true)
|
||||
expect(await exists(path.join(tempRoot, ".config", "opencode", "agents", "repo-research-analyst.md"))).toBe(true)
|
||||
})
|
||||
|
||||
test("list returns plugins in a temp workspace", async () => {
|
||||
@@ -174,8 +175,9 @@ describe("CLI", () => {
|
||||
}
|
||||
|
||||
expect(stdout).toContain("Installed compound-engineering")
|
||||
expect(await exists(path.join(tempRoot, ".opencode", "opencode.json"))).toBe(true)
|
||||
expect(await exists(path.join(tempRoot, ".opencode", "agents", "repo-research-analyst.md"))).toBe(true)
|
||||
// OpenCode global config lives at ~/.config/opencode per XDG spec
|
||||
expect(await exists(path.join(tempRoot, ".config", "opencode", "opencode.json"))).toBe(true)
|
||||
expect(await exists(path.join(tempRoot, ".config", "opencode", "agents", "repo-research-analyst.md"))).toBe(true)
|
||||
})
|
||||
|
||||
test("convert writes OpenCode output", async () => {
|
||||
|
||||
Reference in New Issue
Block a user