MCPcopy
hub / github.com/CapSoftware/Cap / writeAutomationStore

Function writeAutomationStore

apps/desktop/scripts/desktop-memory-soak.js:280–306  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

278}
279
280function writeAutomationStore(path) {
281 if (!existsSync(path)) {
282 throw new Error(`Store not found: ${path}`);
283 }
284
285 const originalStoreContents = readFileSync(path, "utf8");
286 const originalStore = JSON.parse(originalStoreContents);
287 const nextStore = {
288 ...originalStore,
289 hotkeys: {
290 hotkeys: {
291 ...(originalStore.hotkeys?.hotkeys ?? {}),
292 startStudioRecording: HOTKEYS.startStudioRecording,
293 stopRecording: HOTKEYS.stopRecording,
294 },
295 },
296 recording_settings: {
297 ...(originalStore.recording_settings ?? {}),
298 mode: "studio",
299 target: null,
300 },
301 };
302
303 writeFileSync(path, `${JSON.stringify(nextStore, null, 2)}\n`);
304
305 return originalStoreContents;
306}
307
308function modifiersForHotkey(hotkey) {
309 return [

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected