Skip to content

Commit

Permalink
Merge branch 'elixir-waffle:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
makkrnic authored Nov 18, 2023
2 parents 0f765bf + c781d5a commit 01c690b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/mix/tasks/g.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule Mix.Tasks.Waffle do
"""

def run([model_name]) do
app_name = Mix.Project.config[:app]
app_name = Mix.Project.config()[:app]
if File.exists?("lib/#{app_name}_web/") do
project_module_name = camelize(to_string(app_name))
generate_phx_uploader_file(model_name, project_module_name)
Expand All @@ -36,7 +36,7 @@ defmodule Mix.Tasks.Waffle do
end

def run([model_name, path]) do
app_name = Mix.Project.config[:app]
app_name = Mix.Project.config()[:app]
project_module_name = camelize(to_string(app_name))
generate_uploader_file(model_name, project_module_name, path)
end
Expand All @@ -46,13 +46,13 @@ defmodule Mix.Tasks.Waffle do
end

defp generate_uploader_file(model_name, project_module_name, path) do
model_destination = Path.join(File.cwd!, "#{path}/#{underscore(model_name)}.ex")
model_destination = Path.join(File.cwd!(), "#{path}/#{underscore(model_name)}.ex")
create_uploader(model_name, project_module_name, model_destination)
end

defp generate_phx_uploader_file(model_name, project_module_name) do
app_name = Mix.Project.config[:app]
model_destination = Path.join(File.cwd!, "/lib/#{app_name}_web/uploaders/#{underscore(model_name)}.ex")
app_name = Mix.Project.config()[:app]
model_destination = Path.join(File.cwd!(), "/lib/#{app_name}_web/uploaders/#{underscore(model_name)}.ex")
create_uploader(model_name, project_module_name, model_destination)
end

Expand Down

0 comments on commit 01c690b

Please sign in to comment.