We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b550cd4 commit f0b2e3aCopy full SHA for f0b2e3a
package.json
@@ -15,6 +15,7 @@
15
"dependencies": {
16
"chalk": "^2.3.0",
17
"execa": "^0.8.0",
18
+ "find-up": "^2.1.0",
19
"ignore": "^3.3.7",
20
"mri": "^1.1.0"
21
},
src/scms/git.js
@@ -1,12 +1,13 @@
1
import { statSync } from 'fs';
2
import { join } from 'path';
3
+import findUp from 'find-up';
4
import execa from 'execa';
5
6
export const name = 'git';
7
8
export const detect = directory => {
9
try {
- return statSync(join(directory, '.git')).isDirectory();
10
+ return !!findUp.sync('.git', { cwd: directory });
11
} catch (error) {
12
return false;
13
}
0 commit comments