Merge pull request #214 from Jeff-Ciesielski/bugfix/github_trailing_slash_204

Fix for Issue 204
This commit is contained in:
Dominik Picheta 2016-03-17 21:49:58 +00:00
commit ccb52359f0

View file

@ -484,10 +484,17 @@ proc downloadPkg(url: string, verRange: VersionRange,
## which was downloaded.
let downloadDir = (getNimbleTempDir() / getDownloadDirName(url, verRange))
createDir(downloadDir)
let modUrl =
var modUrl =
if url.startsWith("git://") and options.config.cloneUsingHttps:
"https://" & url[6 .. ^1]
else: url
# Fixes issue #204
# github + https + trailing url slash causes a
# checkout/ls-remote to fail with Repository not found
if modUrl.contains("github.com") and modUrl.endswith("/"):
modUrl = modUrl[0 .. ^2]
echo("Downloading ", modUrl, " into ", downloadDir, " using ",
downMethod, "...")
result = (