-
Notifications
You must be signed in to change notification settings - Fork 296
Add REBAR to environment before executing hooks #229
Conversation
Path = escript:script_name(), | ||
[{"REBAR", Path} | Env0] | ||
catch | ||
_:_ -> % rebar was involed programmatically |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/involed/invoked/
Note, it really needs to be BTW, this is already stored in xconf here: |
@uwiger good catch, that can and should be reused. |
[]; | ||
patch_env([{env, Env0} | Rest]) -> | ||
Env = try | ||
Path = escript:script_name(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @uwiger suggested, we should reuse the existing xconf variable here:
Path = rebar_config:get_xconf(Config, escript, ""),
Thanks guys, I've updated the PR. |
@@ -314,6 +315,21 @@ processing_base_dir(Config) -> | |||
processing_base_dir(Config, Dir) -> | |||
Dir =:= rebar_config:get_xconf(Config, base_dir). | |||
|
|||
%% @doc Returns list of environment variables including 'REBAR' which points to the rebar executable used to execute the currently running command. The environment is not modified if rebar was invoked programmatically. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overlong line.
This looks fine, just needs a rebase. |
What's the status? |
REBAR will be set to the rebar binary which was executed and runs the builds. Enables the use of the same binary for rebar invocations as part of a pre or post hook like so: ${REBAR} escriptize
I've rebased the patch. It's been in use without issues. |
Add REBAR to environment before executing hooks
REBAR will be set to the rebar binary which was executed and runs the
builds. Enables the use of the same binary for rebar invocations as
part of a pre or post hook like so: