refactor: use git-node instead of exec git

This commit is contained in:
Christoph Witzko 2015-02-05 13:09:14 +01:00
parent 96fe49662a
commit 5d8f6561a8
2 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@
"confirm-simple": "^1.0.3",
"conventional-changelog": "0.0.11",
"error-first-handler": "^1.0.1",
"git-node": "^0.1.1",
"github": "^0.2.3",
"github-url-from-git": "^1.4.0",
"minimist": "^1.1.0",

View File

@ -1,10 +1,10 @@
'use strict'
var exec = require('child_process').exec
var readFile = require('fs').readFileSync
var url = require('url')
var changelog = require('conventional-changelog')
var git = require('git-node')
var GitHubApi = require('github')
var parseSlug = require('parse-github-repo-url')
var parseUrl = require('github-url-from-git')
@ -31,7 +31,7 @@ module.exports = function (options, cb) {
repository: parseUrl(repository),
file: false
}, efh(cb)(function (log) {
exec('git rev-parse HEAD', efh(cb)(function (hash) {
git.repo('./.git').loadAs('commit', 'HEAD', efh(cb)(function (commit, hash) {
var ghRepo = parseSlug(repository)
var release = {
owner: ghRepo[0],