Skip to content

Commit

Permalink
Merge pull request #26 from QubitProducts/bugfix/gift-regex-fail
Browse files Browse the repository at this point in the history
Ensures bugfix to gift is included in bapistrano when installing with yarn
  • Loading branch information
KidkArolis authored Nov 6, 2017
2 parents 8ab22c7 + 44d4835 commit afc2ea3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/gitMeta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var path = require('path')
var gift = require('gift-wrapper')
var co = require('creed').coroutine
var log = require('./log')
var promisify = require('./promisify')

var gitRoot = findGitRoot()

Expand All @@ -19,10 +20,10 @@ module.exports = co(function * (asBranch) {
if (asBranch) {
branch = asBranch
} else {
branch = (yield repo.branch()).name
branch = (yield promisify(repo, 'branch')()).name
}

var commit = (yield repo.current_commit()).id
var commit = (yield promisify(repo, 'current_commit')()).id

return { branch, commit }
})
Expand Down
10 changes: 10 additions & 0 deletions lib/promisify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = function promisify (obj, method) {
return function () {
return new Promise((resolve, reject) => {
obj[method]((err, val) => {
if (err) return reject(err)
resolve(val)
})
})
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"cli-color": "^1.1.0",
"commander": "^2.9.0",
"creed": "^1.0.1",
"gift-wrapper": "^1.1.1",
"gift": "^0.10.1",
"klaw": "^1.2.0",
"lodash": "^4.15.0",
"mime": "^1.3.4",
Expand Down

0 comments on commit afc2ea3

Please sign in to comment.