fix(growth): use Application.app_dir to write/read priv dir
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
fb38910137
commit
ffa2a68b7a
@ -321,6 +321,8 @@ defmodule Growth.Indicators.Download do
|
||||
end
|
||||
|
||||
def save(data, measurement) do
|
||||
File.write("priv/growth/indicators/#{measurement}.csv", data)
|
||||
:wabanex
|
||||
|> Application.app_dir(["priv", "growth", "indicators", "#{measurement}.csv"])
|
||||
|> File.write(data)
|
||||
end
|
||||
end
|
||||
|
@ -66,7 +66,8 @@ defmodule Growth.Indicators.Load do
|
||||
def all do
|
||||
Logger.debug("load growth indicators")
|
||||
|
||||
"priv/growth/indicators/*.csv"
|
||||
:wabanex
|
||||
|> Application.app_dir(["priv", "growth", "indicators", "*.csv"])
|
||||
|> Path.wildcard()
|
||||
|> Enum.map(&create_ets_from_filename/1)
|
||||
|> Enum.map(&Task.async(__MODULE__, :load_measure, [&1]))
|
||||
|
Loading…
x
Reference in New Issue
Block a user