Skip to content

Commit

Permalink
Update priv path for CSV Seeder
Browse files Browse the repository at this point in the history
  • Loading branch information
altjohndev committed Sep 2, 2020
1 parent e2b0711 commit 209b414
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/asis/release/seeders/csv_seeder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ defmodule Asis.Release.Seeders.CSVSeeder do

require Logger

@app :asis

@spec seed(String.t(), (list() -> :ok), keyword()) :: :ok
def seed(csv_file_path, seeder_function, opts \\ []) do
Logger.debug("Seeding #{csv_file_path}")
Expand All @@ -13,8 +15,9 @@ defmodule Asis.Release.Seeders.CSVSeeder do
Logger.configure(level: :warn)

try do
File.cwd!()
|> Path.join("priv/data/")
@app
|> :code.priv_dir()
|> Path.join("data")
|> Path.join(csv_file_path)
|> File.stream!()
|> get_csv_parser(Keyword.get(opts, :csv_type)).parse_stream()
Expand Down

0 comments on commit 209b414

Please sign in to comment.