This commit is contained in:
Daniel Hengeveld
2015-10-15 16:51:39 +02:00
parent 8e744502fa
commit b566e47a08
2 changed files with 29 additions and 7 deletions

View File

@@ -13,11 +13,20 @@ module.exports = class GitRepositoryAsync {
// this could be replaced with a function
this._opening = true
// Do I use this outside of tests?
openPromise.then( (repo) => {
this.repo = repo
this._opening = false
}).catch( (e) => {
this._opening = false
})
this.repoPromise = openPromise
}
getPath () {
return this.repoPromise.then( (repo) => {
return Promise.resolve(repo.path().replace(/\/$/, ''))
})
}
}