Skip to content

Commit

Permalink
Merge pull request #434 from tgstation/Cyberboss-patch-1
Browse files Browse the repository at this point in the history
Fix GetRepositoryRemote
  • Loading branch information
Cyberboss authored Dec 3, 2017
2 parents 68a0c87 + d897771 commit 7e9ef88
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions TGS.ControlPanel/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ public static bool GetRepositoryRemote(ITGRepository repo, out string owner, out
}

//Assume standard gh format: [(git)|(https)]://github.com/owner/repo(.git)[0-1]
//Yes use .git twice in case it was weird
var toRemove = new string[] { ".git", "/", ".git" };
foreach (string item in toRemove)
if (remote.EndsWith(item))
remote = remote.Substring(0, remote.LastIndexOf(item));
var splits = remote.Split('/');
name = splits[splits.Length - 1];
owner = splits[splits.Length - 2].Split('.')[0];
Expand Down

0 comments on commit 7e9ef88

Please sign in to comment.