Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use code:priv_dir to find application priv directory

In the application skeleton wmskel_sup.erl file, use the application name
and code:priv_dir to find the application priv directory rather than
cobbling the priv dir pathname together relative to the ebin dir.
  • Loading branch information...
commit b544a32c59520340d64da0202c2cd9fd0295d977 1 parent 656aa69
@vinoski vinoski authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 priv/templates/src/wmskel_sup.erl
View
6 priv/templates/src/wmskel_sup.erl
@@ -42,9 +42,9 @@ upgrade() ->
%% @doc supervisor callback.
init([]) ->
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"])),
+ {ok, App} = application:get_application(?MODULE),
+ {ok, Dispatch} = file:consult(filename:join([code:priv_dir(App),
+ "dispatch.conf"])),
WebConfig = [
{ip, Ip},
{port, 8000},
Please sign in to comment.
Something went wrong with that request. Please try again.