Improve parsing logic

This commit is contained in:
Valentin Brandl 2019-07-29 22:34:40 +02:00
parent 62062e5dfb
commit b56eb1ba61
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -14,8 +14,7 @@ parseUrl url =
|> Maybe.andThen |> Maybe.andThen
(\( ( ( ( ( prov, user ), repo ), separator ), gitref ), file ) -> (\( ( ( ( ( prov, user ), repo ), separator ), gitref ), file ) ->
if if
List.isEmpty file (List.head file |> Maybe.map String.isEmpty |> Maybe.withDefault True)
|| (List.head file |> Maybe.map String.isEmpty |> Maybe.withDefault False)
|| (separator /= pathSeparator prov) || (separator /= pathSeparator prov)
then then
Nothing Nothing