diff options
author | Björn Gustavsson <[email protected]> | 2017-03-02 15:03:34 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-03-02 15:33:44 +0100 |
commit | 74e9234a87f6fac98900201a481696b31df2bdab (patch) | |
tree | 8684209adb60df8097fab6d3aa8673f4c32267c3 /lib/dialyzer/src/dialyzer_plt.erl | |
parent | 369ef2ee5586e5cad2f16f0b8f956be011ba1550 (diff) | |
download | otp-74e9234a87f6fac98900201a481696b31df2bdab.tar.gz otp-74e9234a87f6fac98900201a481696b31df2bdab.tar.bz2 otp-74e9234a87f6fac98900201a481696b31df2bdab.zip |
dialyzer, observer: Use portable lookup of home directory
Use init:get_argument(home) to find the location of the home
directory. That will work on all platforms (including Windows).
Note that the run-time system will fail to start if HOME
(or the equivalent on Windows) is not set. Therefore, it can
be assumed that init:get_argument(home) will not fail.
ERL-161
Diffstat (limited to 'lib/dialyzer/src/dialyzer_plt.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_plt.erl | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/dialyzer/src/dialyzer_plt.erl b/lib/dialyzer/src/dialyzer_plt.erl index 0eda73a208..5ababa43dc 100644 --- a/lib/dialyzer/src/dialyzer_plt.erl +++ b/lib/dialyzer/src/dialyzer_plt.erl @@ -234,12 +234,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. |