MCPcopy Create free account
hub / github.com/Microck/opencode-studio / getProfileDir

Function getProfileDir

server/index.js:2775–2790  ·  view source on GitHub ↗
(provider, activePlugin)

Source from the content-addressed store, hash-verified

2773const AUTH_PROFILES_DIR = path.join(HOME_DIR, '.config', 'opencode-studio', 'auth-profiles');
2774
2775const getProfileDir = (provider, activePlugin) => {
2776 let ns = provider;
2777 if (provider === 'google') {
2778 ns = 'google.antigravity';
2779 const nsDir = path.join(AUTH_PROFILES_DIR, ns);
2780 const plainDir = path.join(AUTH_PROFILES_DIR, 'google');
2781 const nsHas = fs.existsSync(nsDir) && fs.readdirSync(nsDir).filter(f => f.endsWith('.json')).length > 0;
2782 const plainHas = fs.existsSync(plainDir) && fs.readdirSync(plainDir).filter(f => f.endsWith('.json')).length > 0;
2783
2784 // Debug
2785 console.log(`[Auth] getProfileDir: ns=${ns}, nsHas=${nsHas}, plainHas=${plainHas}`);
2786
2787 if (!nsHas && plainHas) return plainDir;
2788 }
2789 return path.join(AUTH_PROFILES_DIR, ns);
2790};
2791
2792const listAuthProfiles = (p, activePlugin) => {
2793 const d = getProfileDir(p, activePlugin);

Callers 3

listAuthProfilesFunction · 0.85
index.jsFile · 0.85
buildAccountPoolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected