source: trip-planner-front/node_modules/@npmcli/git/lib/find.js@ 8d391a1

Last change on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 300 bytes
RevLine 
[6a3a178]1const is = require('./is.js')
2const { dirname } = require('path')
3
4module.exports = async ({ cwd = process.cwd() } = {}) => {
5 if (await is({ cwd })) {
6 return cwd
7 }
8 while (cwd !== dirname(cwd)) {
9 cwd = dirname(cwd)
10 if (await is({ cwd })) {
11 return cwd
12 }
13 }
14 return null
15}
Note: See TracBrowser for help on using the repository browser.