-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$HOME/.erlang is not executed by rebar3 shell #2425
Comments
It was never supported, and if it accidentally worked before that was because escripts had it while booting which is out of our control. I think this was covered in a prior issue, but github's search is terribly bad for such a file and I Can't find it. It's possible this works with |
Eh, I think we should consider caring. I use |
Note that even if it is not currently supported when rebar3 is started as an escript, the shell module could still call |
if it's installed as |
If it were added then we'd want to change the shell script to not evaluate it, I think by using the "no dot erlang" boot script or whatever? |
Another vote for this. I have a bunch of debugging helpers in |
For anyone who finds this an wants a workaround: Add this to your {shell, [{script_file, "/full/path/to/rebar.escript"}]}. And create #!/usr/bin/env escript
main(_) ->
% You can put whatever code you want here
code:load_abs(filename:join(os:getenv("HOME"), ".erlang.d/user_default")). If you want to share code between
And in code:load_abs(filename:join(os:getenv("HOME"), ".erlang.d/user_default")). |
You should make a Gist out of this, @eproxus. |
The Erlang documentation states that:
When a
~/.erlang
file exists, it is indeed executed when runningerl
. However this is not the case when Erlang is started withrebar3 shell
.This is a problem because
~/.erlang
is the only way to alter the Erlang environment without affecting the Rebar3 configuration of the project or the application itself (and thus to force your personal preferences to everyone working on the project). For example, it can be used to configure the Erlang logger with different settings (the default configuration is really impractical for development).Is there a reason for this ? If this is done on purpose, would there be a way to add a setting to control this behaviour ?
The text was updated successfully, but these errors were encountered: