From b6a4b64d2fc0d7805631af830ad0ce22b2efcea8 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Thu, 2 Jul 2020 13:55:48 +0300 Subject: [PATCH] Make purl work with dot-git-less repos (#1) --- src/rebar3_sbom_purl.erl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/rebar3_sbom_purl.erl b/src/rebar3_sbom_purl.erl index 2453d21..76fac8b 100644 --- a/src/rebar3_sbom_purl.erl +++ b/src/rebar3_sbom_purl.erl @@ -8,27 +8,27 @@ hex(Name, Version) -> purl(["hex", string:lowercase(Name)], Version). git(_Name, "git@github.com:" ++ Github, Ref) -> - [Repo, _, _] = string:replace(Github, ".git", "", trailing), + Repo = string:replace(Github, ".git", "", trailing), github(Repo, Ref); git(_Name, "https://github.com/" ++ Github, Ref) -> - [Repo, _, _] = string:replace(Github, ".git", "", trailing), + Repo = string:replace(Github, ".git", "", trailing), github(Repo, Ref); git(_Name, "git://github.com/" ++ Github, Ref) -> - [Repo, _, _] = string:replace(Github, ".git", "", trailing), + Repo = string:replace(Github, ".git", "", trailing), github(Repo, Ref); git(_Name, "git@bitbucket.org:" ++ Github, Ref) -> - [Repo, _, _] = string:replace(Github, ".git", "", trailing), + Repo = string:replace(Github, ".git", "", trailing), bitbucket(Repo, Ref); git(_Name, "https://bitbucket.org/" ++ Github, Ref) -> - [Repo, _, _] = string:replace(Github, ".git", "", trailing), + Repo = string:replace(Github, ".git", "", trailing), bitbucket(Repo, Ref); git(_Name, "git://bitbucket.org/" ++ Github, Ref) -> - [Repo, _, _] = string:replace(Github, ".git", "", trailing), + Repo = string:replace(Github, ".git", "", trailing), bitbucket(Repo, Ref); %% Git dependence other than GitHub and BitBucket are not currently supported