Portability via filename:join/1

This commit is contained in:
Scott Lystig Fritchie 2011-08-23 14:22:04 -05:00
parent f79290dc9c
commit b674ea19a4

View file

@ -528,8 +528,9 @@ kill_extras(Pids) ->
reconstruct_app_env_vars([App|Apps]) -> reconstruct_app_env_vars([App|Apps]) ->
CmdLine0 = proplists:get_value(App, init:get_arguments(), []), CmdLine0 = proplists:get_value(App, init:get_arguments(), []),
CmdVars = [{list_to_atom(K), list_to_atom(V)} || {K, V} <- CmdLine0], CmdVars = [{list_to_atom(K), list_to_atom(V)} || {K, V} <- CmdLine0],
AppFile = (catch code:lib_dir(App) ++ AppFile = (catch filename:join([code:lib_dir(App),
"/ebin/" ++ atom_to_list(App) ++ ".app"), "ebin",
atom_to_list(App) ++ ".app"])),
AppVars = case file:consult(AppFile) of AppVars = case file:consult(AppFile) of
{ok, [{application, App, Ps}]} -> {ok, [{application, App, Ps}]} ->
proplists:get_value(env, Ps, []); proplists:get_value(env, Ps, []);