MCPcopy
hub / github.com/anomalyco/opencode / getStore

Function getStore

packages/desktop/src/main/store.ts:13–24  ·  view source on GitHub ↗
(name = SETTINGS_STORE)

Source from the content-addressed store, hash-verified

11// in index.ts has executed, which would result in files being written to the default directory
12// (e.g. bad: %APPDATA%\@opencode-ai\desktop\opencode.settings vs good: %APPDATA%\ai.opencode.desktop.dev\opencode.settings).
13export function getStore(name = SETTINGS_STORE) {
14 const cached = cache.get(name)
15 if (cached) return cached
16 const next = new Store({
17 name,
18 cwd: electron.app.getPath("userData"),
19 fileExtension: "",
20 accessPropertiesByDotNotation: false,
21 })
22 cache.set(name, next)
23 return next
24}
25
26export async function removeStoreFileIfEmpty(name: string) {
27 if (await deleteStoreFileIfEmpty(electron.app.getPath("userData"), name)) cache.delete(name)

Callers 12

registerIpcHandlersFunction · 0.90
setupAutoUpdaterFunction · 0.90
setPinchZoomEnabledFunction · 0.90
getPinchZoomEnabledFunction · 0.90
readWindowIDsFunction · 0.90
writeWindowIDsFunction · 0.90
getDefaultServerUrlFunction · 0.90
setDefaultServerUrlFunction · 0.90
migrateFileFunction · 0.90
migrateFunction · 0.90
readPersistedServersFunction · 0.90
writePersistedServersFunction · 0.90

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected