(dir, binName, root)
| 12 | } |
| 13 | |
| 14 | const localFileExists = async (dir, binName, root) => { |
| 15 | for (const path of walkUp(dir)) { |
| 16 | const binDir = resolve(path, 'node_modules', '.bin') |
| 17 | |
| 18 | if (await fileExists(resolve(binDir, binName))) { |
| 19 | return binDir |
| 20 | } |
| 21 | |
| 22 | if (path.toLowerCase() === resolve(root).toLowerCase()) { |
| 23 | return false |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | return false |
| 28 | } |
| 29 | |
| 30 | module.exports = { |
| 31 | fileExists, |
no test coverage detected