MCPcopy Create free account
hub / github.com/TheNetsky/Microsoft-Rewards-Script / getSessionDbPath

Function getSessionDbPath

scripts/utils.js:252–262  ·  view source on GitHub ↗
(projectRoot, sessionPath)

Source from the content-addressed store, hash-verified

250}
251
252export function getSessionDbPath(projectRoot, sessionPath) {
253 const candidates = [
254 path.resolve(process.cwd(), sessionPath, 'sessions.db'),
255 path.join(projectRoot, sessionPath, 'sessions.db'),
256 path.join(projectRoot, 'dist', sessionPath, 'sessions.db'),
257 path.join(projectRoot, 'src', sessionPath, 'sessions.db')
258 ]
259
260 const found = candidates.find(p => fs.existsSync(p))
261 return { dbPath: found ?? candidates[0], exists: Boolean(found), candidates }
262}
263
264export function openSessionDb(dbPath, { readonly = false } = {}) {
265 return new DatabaseSync(dbPath, { readOnly: readonly })

Callers 2

clearSessions.jsFile · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected