UNPKG

cz-conventional-changelog-befe

Version:
20 lines (17 loc) 395 B
/** * @file gitRemoteUrl * @author Cuttle Cong * @date 2018/10/25 * */ const gitconfig = require('gitconfiglocal') const pify = require('pify') module.exports = (dir, { remoteName = 'origin' } = {}) => { return pify(gitconfig)(dir || process.cwd()).then(config => { return ( config.remote && config.remote[remoteName] && config.remote[remoteName].url ) }) }