From 4a78953fc6d135f45de0b07bda18a44a351ba79d Mon Sep 17 00:00:00 2001 From: waylon531 Date: Tue, 25 Jul 2017 17:10:05 -0700 Subject: [PATCH] Added better url detection to publish Publish will now look at the hostname part of the ssh url to figure out what git server to use. This definitely works with both github and gitlab, and adds gitlab support to `nimble publish`. --- src/nimblepkg/publish.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nimblepkg/publish.nim b/src/nimblepkg/publish.nim index 2a4ce93..a0bca66 100644 --- a/src/nimblepkg/publish.nim +++ b/src/nimblepkg/publish.nim @@ -206,7 +206,7 @@ proc publish*(p: PackageInfo, o: Options) = if parsed.scheme == "": # Assuming that we got an ssh write/read URL. let sshUrl = parseUri("ssh://" & url) - url = "https://github.com/" & sshUrl.port & sshUrl.path + url = "https://" & sshUrl.hostname & "/" & sshUrl.port & sshUrl.path elif dirExists(os.getCurrentDir() / ".hg"): downloadMethod = "hg" # TODO: Retrieve URL from hg.