Skip to content

Commit f0b2e3a

Browse files
committed
feat: support running in git subdirs
1 parent b550cd4 commit f0b2e3a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"dependencies": {
1616
"chalk": "^2.3.0",
1717
"execa": "^0.8.0",
18+
"find-up": "^2.1.0",
1819
"ignore": "^3.3.7",
1920
"mri": "^1.1.0"
2021
},

src/scms/git.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { statSync } from 'fs';
22
import { join } from 'path';
3+
import findUp from 'find-up';
34
import execa from 'execa';
45

56
export const name = 'git';
67

78
export const detect = directory => {
89
try {
9-
return statSync(join(directory, '.git')).isDirectory();
10+
return !!findUp.sync('.git', { cwd: directory });
1011
} catch (error) {
1112
return false;
1213
}

0 commit comments

Comments
 (0)