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:
@@ -4,13 +4,14 @@ import path from 'path';
|
||||
|
||||
import { assertGitAvailable, looksLikeAuthError, runGit } from './git.js';
|
||||
import { parseSkillRepoSource } from './source.js';
|
||||
import { OPENCODE_CONFIG_DIR } from '../opencode/shared.js';
|
||||
|
||||
const SKILL_NAME_PATTERN = /^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]$/;
|
||||
|
||||
function normalizeUserSkillDir(userSkillDir) {
|
||||
if (!userSkillDir) return null;
|
||||
const legacySkillDir = path.join(os.homedir(), '.config', 'opencode', 'skill');
|
||||
const pluralSkillDir = path.join(os.homedir(), '.config', 'opencode', 'skills');
|
||||
const legacySkillDir = path.join(OPENCODE_CONFIG_DIR, 'skill');
|
||||
const pluralSkillDir = path.join(OPENCODE_CONFIG_DIR, 'skills');
|
||||
if (userSkillDir === legacySkillDir) {
|
||||
if (fs.existsSync(legacySkillDir) && !fs.existsSync(pluralSkillDir)) return legacySkillDir;
|
||||
return pluralSkillDir;
|
||||
|
||||
Reference in New Issue
Block a user