Skip to content

Commit 095c49a

Browse files
committed
fix(elixir:gsmlg): Fix :code.priv_dir to elixir Application.app_dir and fix Path.join.
1 parent 8a7d26e commit 095c49a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

elixir/gsmlg_umbrella/apps/gsmlg_web/lib/gsmlg_web/controllers/page_controller.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ defmodule GSMLGWeb.PageController do
2929
path = if path == "/", do: "/index", else: path
3030

3131
cond do
32-
File.exists?(file_path = Path.join(:code.priv_dir(:gsmlg_web), "static", path <> ".html")) ->
32+
File.exists?(file_path = Path.join([Application.app_dir(:gsmlg_web), "priv", "static", path <> ".html"])) ->
3333
{:html, file_path}
3434

3535
File.exists?(
36-
file_path = Path.join(:code.priv_dir(:gsmlg_web), "static", path, "/index.html")
36+
file_path = Path.join([Application.app_dir(:gsmlg_web), "priv", "static", path, "/index.html"])
3737
) ->
3838
{:html, file_path}
3939

40-
File.exists?(file_path = Path.join(:code.priv_dir(:gsmlg_web), "static/404.html")) ->
40+
File.exists?(file_path = Path.join([Application.app_dir(:gsmlg_web), "priv", "static", "404.html"])) ->
4141
{:not_found_page, file_path}
4242

4343
true ->

0 commit comments

Comments
 (0)