MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / initializeWarningsFile

Function initializeWarningsFile

plugins/warn.js:11–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9const databaseDir = path.join(process.cwd(), 'data');
10const warningsPath = path.join(databaseDir, 'warnings.json');
11function initializeWarningsFile() {
12 if (!HAS_DB) {
13 if (!fs.existsSync(databaseDir)) {
14 fs.mkdirSync(databaseDir, { recursive: true });
15 }
16 if (!fs.existsSync(warningsPath)) {
17 fs.writeFileSync(warningsPath, JSON.stringify({}), 'utf8');
18 }
19 }
20}
21async function getWarnings() {
22 if (HAS_DB) {
23 const warnings = await store.getSetting('global', 'warnings');

Callers 1

handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected