atlas-repo-info
Get basic git repository information about a directory.
install
npm install --save atlas-repo-info
why
This function returns basic git information about a directory, so you don't need to clutter your codebase with git-related exec
or spawn
calls.
examples
All you need to do is pass in the desired path to inspect, and a callback. If there is no info
object passed to the callback, it means the passed directory is not a git repository. See caveats.
const getRepoInfo = ;const projectPath = process;
caveats
You might run into issues if used with a bare repository (i.e. repoistories created with git init --bare
). No check is currently implemented for bare repositories. It might be implemented later if I need it.