Skip to content

Commit

Permalink
Check if the parsed url is local repo
Browse files Browse the repository at this point in the history
@bahmutov This will never throw an error. To check if remote, you have to check if `parsedUrl.protocol !== "file"`. But I already fixed this. 🎈
  • Loading branch information
IonicaBizau committed Nov 10, 2015
1 parent f0d0da3 commit 0ee4383
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,9 @@ GitIssues.prototype.fromProvider = function (providerName, user, repo, status, a
*/
GitIssues.prototype.fromPath = function (path, status, auth, callback) {

try {
parsedUrl = GitUrlParse(path);
this.fromProvider(parsedUrl.source, parsedUrl.owner, parsedUrl.name, status, auth, callback);
return;
} catch (err) {
// path is NOT an url, continue as before
var parsedUrl = GitUrlParse(path);
if (parsedUrl.protocol !== "file") {
return this.fromProvider(parsedUrl.source, parsedUrl.owner, parsedUrl.name, status, auth, callback);
}

if (!IsThere(path)) {
Expand Down

0 comments on commit 0ee4383

Please sign in to comment.