Skip to content

Commit

Permalink
Allow plugin libs to use their otp app name
Browse files Browse the repository at this point in the history
  • Loading branch information
bcardarella committed May 2, 2024
1 parent 3aaa87a commit 5f82496
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/mix/lvn.test_helper.ex
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ defmodule Mix.Lvn.TestHelper do
end

def in_tmp_live_project(test, func) do
app = Mix.Phoenix.context_app()

in_tmp_project(test, fn ->
File.mkdir_p!("lib")
File.touch!("lib/live_view_native_web.ex")
File.touch!("lib/live_view_native.ex")
File.touch!("lib/#{app}_web.ex")
File.touch!("lib/#{app}.ex")
func.()
end)
end
Expand Down Expand Up @@ -85,11 +87,13 @@ defmodule Mix.Lvn.TestHelper do
end

def in_tmp_live_umbrella_project(test, func) do
app = Mix.Phoenix.context_app()

in_tmp_umbrella_project(test, fn ->
File.mkdir_p!("live_view_native/lib")
File.mkdir_p!("live_view_native_web/lib")
File.touch!("live_view_native/lib/live_view_native.ex")
File.touch!("live_view_native_web/lib/live_view_native_web.ex")
File.mkdir_p!("#{app}/lib")
File.mkdir_p!("#{app}_web/lib")
File.touch!("#{app}/lib/#{app}.ex")
File.touch!("#{app}_web/lib/#{app}_web.ex")
func.()
end)
end
Expand Down

0 comments on commit 5f82496

Please sign in to comment.