aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-03-03 11:52:10 +0100
committerBjörn Gustavsson <[email protected]>2017-03-03 11:52:10 +0100
commitb14e556b334069ca60b1be1a1ed45374daf8e1fc (patch)
tree3e6c9c951e5a1e2cdfb459b4c9b6a978c055cd80 /lib
parente7ec27f781b2db75b7b82903ae73f089a1b3286a (diff)
parent0438c6c2c5c4a447ab3a47a443968488a0d835eb (diff)
downloadotp-b14e556b334069ca60b1be1a1ed45374daf8e1fc.tar.gz
otp-b14e556b334069ca60b1be1a1ed45374daf8e1fc.tar.bz2
otp-b14e556b334069ca60b1be1a1ed45374daf8e1fc.zip
Merge branch 'maint'
* maint: tools: Use portable lookup of home directory dialyzer, observer: Use portable lookup of home directory
Diffstat (limited to 'lib')
-rw-r--r--lib/dialyzer/src/dialyzer_plt.erl8
-rw-r--r--lib/observer/src/observer_wx.erl3
-rw-r--r--lib/tools/examples/xref_examples.erl2
3 files changed, 5 insertions, 8 deletions
diff --git a/lib/dialyzer/src/dialyzer_plt.erl b/lib/dialyzer/src/dialyzer_plt.erl
index eb63e9e695..bfd3f84fc5 100644
--- a/lib/dialyzer/src/dialyzer_plt.erl
+++ b/lib/dialyzer/src/dialyzer_plt.erl
@@ -233,12 +233,8 @@ contains_mfa(#plt{info = Info, contracts = Contracts}, MFA) ->
get_default_plt() ->
case os:getenv("DIALYZER_PLT") of
false ->
- case os:getenv("HOME") of
- false ->
- plt_error("The HOME environment variable needs to be set " ++
- "so that Dialyzer knows where to find the default PLT");
- HomeDir -> filename:join(HomeDir, ".dialyzer_plt")
- end;
+ {ok,[[HomeDir]]} = init:get_argument(home),
+ filename:join(HomeDir, ".dialyzer_plt");
UserSpecPlt -> UserSpecPlt
end.
diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl
index 3031a1f90d..83de4fa64c 100644
--- a/lib/observer/src/observer_wx.erl
+++ b/lib/observer/src/observer_wx.erl
@@ -636,7 +636,8 @@ create_connect_dialog(connect, #state{frame = Frame}) ->
wxWindow:setSizerAndFit(Dialog, VSizer),
wxSizer:setSizeHints(VSizer, Dialog),
- CookiePath = filename:join(os:getenv("HOME"), ".erlang.cookie"),
+ {ok,[[HomeDir]]} = init:get_argument(home),
+ CookiePath = filename:join(HomeDir, ".erlang.cookie"),
DefaultCookie = case filelib:is_file(CookiePath) of
true ->
{ok, Bin} = file:read_file(CookiePath),
diff --git a/lib/tools/examples/xref_examples.erl b/lib/tools/examples/xref_examples.erl
index 4c082195a2..f7e71c9708 100644
--- a/lib/tools/examples/xref_examples.erl
+++ b/lib/tools/examples/xref_examples.erl
@@ -7,7 +7,7 @@
%% ${HOME}/unused_locals.txt.
script() ->
Root = code:root_dir(),
- Dir = os:getenv("HOME"),
+ {ok,[[Dir]]} = init:get_argument(home),
Server = s,
xref:start(Server),
{ok, _Relname} = xref:add_release(Server, code:lib_dir(), {name,otp}),