Comparing version 1.1.4 to 1.1.5
@@ -112,3 +112,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
case 0: | ||
if (!this.app.gitInfo.gitFolderPresent()) { | ||
if (!this.app.gitInfo.gitFolderPath()) { | ||
return [2 /*return*/, new No_Git_Folder_1.NoGitFolderPage(this.app, this.t)]; | ||
@@ -126,3 +126,3 @@ } | ||
.write(this.t.interactor.color.yellow('Repository: ')) | ||
.write(this.app.gitInfo.currentDirectory().split('/').pop()) | ||
.write(this.app.gitInfo.gitFolderPath().split('/').splice(-2)[0]) | ||
.newLine() | ||
@@ -129,0 +129,0 @@ .write(this.t.interactor.color.yellow('Current branch: ')) |
@@ -25,2 +25,3 @@ var __read = (this && this.__read) || function (o, n) { | ||
function GitInfo() { | ||
this.pathToGitFolder = null; | ||
} | ||
@@ -30,7 +31,15 @@ GitInfo.prototype.currentDirectory = function () { | ||
}; | ||
GitInfo.prototype.gitFolderPresent = function () { | ||
return fs_1.existsSync(this.gitFolderPath()); | ||
}; | ||
GitInfo.prototype.gitFolderPath = function () { | ||
return this.currentDirectory() + "/.git"; | ||
if (this.pathToGitFolder) | ||
return this.pathToGitFolder; | ||
var pathSteps = this.currentDirectory().split('/'); | ||
while (pathSteps.length > 0) { | ||
var path = pathSteps.join('/') + '/.git'; | ||
if (fs_1.existsSync(path)) { | ||
this.pathToGitFolder = path; | ||
return path; | ||
} | ||
pathSteps.pop(); | ||
} | ||
return; | ||
}; | ||
@@ -37,0 +46,0 @@ GitInfo.prototype.gitFolderPathWithSlash = function () { |
{ | ||
"name": "agita", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"main": "bin/index.js", | ||
@@ -5,0 +5,0 @@ "author": "Joel Huggett", |
111291
2400