Skip to content

Commit

Permalink
feat: support running in git subdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
azz committed Jan 9, 2018
1 parent b550cd4 commit f0b2e3a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dependencies": {
"chalk": "^2.3.0",
"execa": "^0.8.0",
"find-up": "^2.1.0",
"ignore": "^3.3.7",
"mri": "^1.1.0"
},
Expand Down
3 changes: 2 additions & 1 deletion src/scms/git.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { statSync } from 'fs';
import { join } from 'path';
import findUp from 'find-up';
import execa from 'execa';

export const name = 'git';

export const detect = directory => {
try {
return statSync(join(directory, '.git')).isDirectory();
return !!findUp.sync('.git', { cwd: directory });
} catch (error) {
return false;
}
Expand Down

0 comments on commit f0b2e3a

Please sign in to comment.