fix: version string splitting (#25)

This commit is contained in:
Igor Barakaiev 2024-06-28 00:53:44 +03:00 committed by GitHub
parent 6bca8705dd
commit e72aa1ee4a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -175,7 +175,7 @@ defmodule Igniter.Util.Install do
end end
defp determine_dep_type_and_version(requirement) do defp determine_dep_type_and_version(requirement) do
case String.split(requirement, "@", trim: true) do case String.split(requirement, "@", trim: true, parts: 2) do
[package] -> [package] ->
if Regex.match?(~r/^[a-z][a-z0-9_]*$/, package) do if Regex.match?(~r/^[a-z][a-z0-9_]*$/, package) do
case Req.get!("https://hex.pm/api/packages/#{package}").body do case Req.get!("https://hex.pm/api/packages/#{package}").body do