summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/@npmcli/git/lib/find.js
blob: 2d2ad308665de1e860ed328425e0d4ab4b1d2188 (plain)
1
2
3
4
5
6
7
const is = require('./is.js')
const { dirname } = require('path')
const check = (cwd, prev) => is({ cwd }).then(isGit =>
  isGit ? cwd
  : cwd === prev ? null
  : check(dirname(cwd), cwd))
module.exports = ({ cwd = process.cwd() } = {}) => check(cwd)