fix(web): honor XDG_CONFIG_HOME for OpenCode paths (#3305)
Closes #3304. Thanks for consolidating the global OpenCode paths. VS Code path parity and effective-path display follow-ups are maintainer-owned.
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
getProviderSources,
|
||||
removeProviderConfig,
|
||||
} from './providers.js';
|
||||
import { OPENCODE_CONFIG_DIR } from './shared.js';
|
||||
|
||||
let projectDir;
|
||||
|
||||
@@ -334,8 +335,8 @@ describe('custom provider config persistence', () => {
|
||||
expect(sources.sources.custom.exists).toBe(false);
|
||||
|
||||
for (const userPath of [
|
||||
path.join(os.homedir(), '.config', 'opencode', 'opencode.json'),
|
||||
path.join(os.homedir(), '.config', 'opencode', 'config.json'),
|
||||
path.join(OPENCODE_CONFIG_DIR, 'opencode.json'),
|
||||
path.join(OPENCODE_CONFIG_DIR, 'config.json'),
|
||||
]) {
|
||||
if (!fs.existsSync(userPath)) continue;
|
||||
const userConfig = readJson(userPath);
|
||||
@@ -373,8 +374,8 @@ describe('custom provider config persistence', () => {
|
||||
expect(sources.sources.project.exists).toBe(false);
|
||||
|
||||
for (const userPath of [
|
||||
path.join(os.homedir(), '.config', 'opencode', 'opencode.json'),
|
||||
path.join(os.homedir(), '.config', 'opencode', 'config.json'),
|
||||
path.join(OPENCODE_CONFIG_DIR, 'opencode.json'),
|
||||
path.join(OPENCODE_CONFIG_DIR, 'config.json'),
|
||||
]) {
|
||||
if (!fs.existsSync(userPath)) continue;
|
||||
const userConfig = readJson(userPath);
|
||||
|
||||
Reference in New Issue
Block a user