Skip to content

Commit d03ae53

Browse files
Update dependency_definition.cr
Co-authored-by: Johannes Müller <[email protected]>
1 parent ac81d3c commit d03ae53

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/dependency_definition.cr

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,13 @@ module Shards
7272
else
7373
raise Shards::Error.new("Cannot determine resolver for HTTPS URI: #{value}")
7474
end
75-
when "git"
76-
if uri.host
77-
Parts.new("git", uri.to_s)
78-
else
79-
Parts.new("git", uri.path)
80-
end
81-
when "git+https"
82-
uri.scheme = "https"
83-
Parts.new("git", uri.to_s)
8475
else
85-
if resolver_class = Resolver::RESOLVER_CLASSES[scheme]?
86-
uri.scheme = nil
76+
scheme, _, subscheme = scheme.partition('+')
77+
subscheme = subscheme.presence
78+
if Resolver.find_class(scheme)
79+
if uri.host.nil? || subscheme
80+
uri.scheme = subscheme
81+
end
8782
source = uri.to_s
8883
# narrow down requirement
8984
requirement = Any

0 commit comments

Comments
 (0)