Merge pull request #214 from Jeff-Ciesielski/bugfix/github_trailing_slash_204
Fix for Issue 204
This commit is contained in:
commit
ccb52359f0
1 changed files with 8 additions and 1 deletions
|
|
@ -484,10 +484,17 @@ proc downloadPkg(url: string, verRange: VersionRange,
|
||||||
## which was downloaded.
|
## which was downloaded.
|
||||||
let downloadDir = (getNimbleTempDir() / getDownloadDirName(url, verRange))
|
let downloadDir = (getNimbleTempDir() / getDownloadDirName(url, verRange))
|
||||||
createDir(downloadDir)
|
createDir(downloadDir)
|
||||||
let modUrl =
|
var modUrl =
|
||||||
if url.startsWith("git://") and options.config.cloneUsingHttps:
|
if url.startsWith("git://") and options.config.cloneUsingHttps:
|
||||||
"https://" & url[6 .. ^1]
|
"https://" & url[6 .. ^1]
|
||||||
else: url
|
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 ",
|
echo("Downloading ", modUrl, " into ", downloadDir, " using ",
|
||||||
downMethod, "...")
|
downMethod, "...")
|
||||||
result = (
|
result = (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue