Skip to content

Commit

Permalink
fix: improve JIRA Id extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Wišo committed Jan 22, 2023
1 parent b44ab23 commit 0b273a7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions changelog2jira.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ case OptionParser.parse(System.argv(), strict: [version: :string, path: :string]
{"ul", [], children, %{}}, acc ->
Enum.reduce(children, acc, fn
{"li", [], [{"strong", [], [jira_id], %{}} | _rest], %{}}, acc ->
[jira_id |> String.replace(":", "") |> String.upcase() | acc]
jira_id = jira_id |> String.replace(":", "") |> String.upcase()

if String.contains?(jira_id, "-") do
String.split(jira_id, ",") ++ acc
else
acc
end

_other, acc ->
acc
Expand Down Expand Up @@ -91,9 +97,7 @@ case OptionParser.parse(System.argv(), strict: [version: :string, path: :string]
end

_other ->
IO.puts(
"Usage: elixir changelog2jira.ex --path=<your_project_changelog> --version=latest"
)
IO.puts("Usage: elixir changelog2jira.ex --path=<your_project_changelog> --version=latest")

System.stop(1)
end

0 comments on commit 0b273a7

Please sign in to comment.