Uh oh!
There was an error while loading. Please reload this page.
fix(adapter): looks for adapter relative to git root - #327
Conversation
instead of npm root, which may not exist fixescommitizen#324
AndersDJohnson
commented
Aug 16, 2016
Should consider pros & cons of ShellJS + |
LinusU
commented
Aug 16, 2016
I don't like ShellJS at all and would love to get rid of it, but this is currently breaking for some of our users so I would like to get this landed as soon as possible. Pull request to refactor welcome :) |
LinusU
commented
Aug 16, 2016
Thanks for the quick response @pmcelhaney 🎉 |
pmcelhaney
commented
Aug 16, 2016
I prefer asking git for the root path rather than looking for the .git directory because I don't know if there's some edge case in which searching for the .git directory doesn't work. For example, is it possible to create a file called .git in a subdirectory? Is it possible to configure git so the directory is called something other ".git"? |
LinusU
commented
Aug 16, 2016
That's true, would be nice to switch to e.g. execa so that it's not blocking but instead gives a promise. Should probably have clarified but the thing I don't like about ShellJS is the synchronous nature of it... |
pmcelhaney
commented
Aug 16, 2016
I'm thinking about creating a new npm module that can find the various root / home folders across all OSes. varrootz=require('rootz');vargit=rootz.sync.git(),hg=rootz.sync.hg(),svn=rootz.sync.svn(),npm=rootz.sync.npmPackage(),home=rootz.sync.userHome(),
...
// non-blockingrootz.git().then(function(gitRootDirectory){
...
})What do you think? Would that be useful? |
LinusU
commented
Aug 16, 2016
I personally like small focused packages (some reading). Maybe make it multiple packages with one package that depends on the other if someone wants that. Then we we could to: constgitRoot=require('rootz-git')gitRoot().then(dir=>{// ...})without having to add anything that isn't related to git to this package. |
instead of npm root, which may not exist
fixes#324