Skip to content

Commit

Permalink
Call :code.priv_dir/1 at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieuprog committed Jul 27, 2021
1 parent 571482c commit 4a3900b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/iana_data_dir.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
defmodule Tz.IanaDataDir do
@regex_tzdata_dir_name ~r/^tzdata20[0-9]{2}[a-z]$/
@custom_data_dir Application.get_env(:tz, :data_dir)

defp dir, do: Application.get_env(:tz, :data_dir, :code.priv_dir(:tz))
defp dir(), do: @custom_data_dir || :code.priv_dir(:tz)

def tzdata_dir_name(parent_dir \\ dir()) do
tz_data_dirs =
Expand Down

0 comments on commit 4a3900b

Please sign in to comment.