Last change
on this file since 6fe77af was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
300 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | const is = require('./is.js')
|
---|
| 2 | const { dirname } = require('path')
|
---|
| 3 |
|
---|
| 4 | module.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.