From 25196f4b994df5364eb060bff8418a0154622ed4 Mon Sep 17 00:00:00 2001 From: bitnitdit Date: Mon, 11 Sep 2017 20:57:17 +0800 Subject: Prevent .erlang from prepending string to the erl root dir Any output string from .erlang to stdout will be prepend to code:root_dir(), so it will cause the retrieved dir incorrect. The fix is to start erl with the no_dot_erlang boot file. --- priv/templates/bin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'priv/templates/bin') diff --git a/priv/templates/bin b/priv/templates/bin index 8bb6890..523b88d 100755 --- a/priv/templates/bin +++ b/priv/templates/bin @@ -22,7 +22,7 @@ find_erts_dir() { else __erl="$(which erl)" code="io:format(\"~s\", [code:root_dir()]), halt()." - __erl_root="$("$__erl" -noshell -eval "$code")" + __erl_root="$("$__erl" -boot no_dot_erlang -noshell -eval "$code")" ERTS_DIR="$__erl_root/erts-$ERTS_VSN" ROOTDIR="$__erl_root" fi -- cgit v1.2.3