(currentDir)
| 9 | } |
| 10 | |
| 11 | export 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 | |
| 22 | export function log(level, ...args) { |
| 23 | console.log(`[${level}]`, ...args) |
no outgoing calls
no test coverage detected