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

Function getProjectRoot

scripts/utils.js:11–20  ·  view source on GitHub ↗
(currentDir)

Source from the content-addressed store, hash-verified

9}
10
11export function getProjectRoot(currentDir) {
12 let dir = currentDir
13 while (dir !== path.parse(dir).root) {
14 if (fs.existsSync(path.join(dir, 'package.json'))) {
15 return dir
16 }
17 dir = path.dirname(dir)
18 }
19 throw new Error('Could not find project root (package.json not found)')
20}
21
22export function log(level, ...args) {
23 console.log(`[${level}]`, ...args)

Callers 2

clearSessions.jsFile · 0.90
browserSession.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected