mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Fix package manager when "git@url" is used
This commit is contained in:
@ -28,11 +28,16 @@ class VCSClientFactory(object):
|
|||||||
def newClient(src_dir, remote_url):
|
def newClient(src_dir, remote_url):
|
||||||
result = urlparse(remote_url)
|
result = urlparse(remote_url)
|
||||||
type_ = result.scheme
|
type_ = result.scheme
|
||||||
if "+" in result.scheme:
|
if not type_ and remote_url.startswith("git@"):
|
||||||
|
type_ = "git"
|
||||||
|
elif "+" in result.scheme:
|
||||||
type_, _ = result.scheme.split("+", 1)
|
type_, _ = result.scheme.split("+", 1)
|
||||||
remote_url = remote_url[len(type_) + 1:]
|
remote_url = remote_url[len(type_) + 1:]
|
||||||
if result.fragment:
|
if result.fragment:
|
||||||
remote_url = remote_url.rsplit("#", 1)[0]
|
remote_url = remote_url.rsplit("#", 1)[0]
|
||||||
|
if not type_:
|
||||||
|
raise PlatformioException("VCS: Unknown repository type %s" %
|
||||||
|
remote_url)
|
||||||
obj = getattr(modules[__name__], "%sClient" % type_.title())(
|
obj = getattr(modules[__name__], "%sClient" % type_.title())(
|
||||||
src_dir, remote_url, result.fragment)
|
src_dir, remote_url, result.fragment)
|
||||||
assert isinstance(obj, VCSClientBase)
|
assert isinstance(obj, VCSClientBase)
|
||||||
|
Reference in New Issue
Block a user