From 6a86e2d5f654929d89b1a5e1752bfd0e51faa539 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Tue, 13 Aug 2024 19:14:11 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20don't=20hardcode=20`Foo.Supervisor`=20?= =?UTF-8?q?=F0=9F=A4=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #78 --- lib/igniter/project/application.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/igniter/project/application.ex b/lib/igniter/project/application.ex index 9725462..5e113c1 100644 --- a/lib/igniter/project/application.ex +++ b/lib/igniter/project/application.ex @@ -95,8 +95,9 @@ defmodule Igniter.Project.Application do end) end - defp create_application_file(igniter, application) do + def create_application_file(igniter, application) do path = Igniter.Code.Module.proper_location(application) + supervisor = Igniter.Code.Module.module_name("Supervisor") contents = """ defmodule #{inspect(application)} do @@ -108,7 +109,7 @@ defmodule Igniter.Project.Application do def start(_type, _args) do children = [] - opts = [strategy: :one_for_one, name: Foo.Supervisor] + opts = [strategy: :one_for_one, name: #{inspect(supervisor)}] Supervisor.start_link(children, opts) end end