autodetect erlang dir for mac os