Commits

Anonymous committed 63dbc0c

find dispatch.conf from code dir, not cwd

(via steve vinoski and pablo platt)

  • Participants
  • Parent commits bb43b93

Comments (0)

Files changed (1)

File priv/skel/src/skel_sup.erl

 %% @spec init([]) -> SupervisorTree
 %% @doc supervisor callback.
 init([]) ->
-    Ip = case os:getenv("WEBMACHINE_IP") of false -> "0.0.0.0"; Any -> Any end,   
-    {ok, Dispatch} = file:consult("priv/dispatch.conf"),
+    Ip = case os:getenv("WEBMACHINE_IP") of false -> "0.0.0.0"; Any -> Any end,
+    {ok, Dispatch} = file:consult(filename:join(
+                         [filename:dirname(code:which(?MODULE)),
+                          "..", "priv", "dispatch.conf"])),
     WebConfig = [
 		 {ip, Ip},
 		 {port, 8000},