Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use file:script if a .config.script file present

  • Loading branch information...
commit c66917928b08b43c6e9aeb96dbeff7e94f045944 1 parent 6ada1c2
@uwiger authored
Showing with 14 additions and 2 deletions.
  1. +14 −2 src/rebar_config.erl
View
16 src/rebar_config.erl
@@ -133,8 +133,20 @@ get_jobs() ->
%% ===================================================================
consult_file(File) ->
- ?DEBUG("Consult config file ~p~n", [File]),
- file:consult(File).
+ case filename:extension(File) of
+ ".script" ->
+ file:script(File, [{'SCRIPT', File}]);
+ _ ->
+ Script = File ++ ".script",
+ case file:read_file_info(Script) of
@tuncer
tuncer added a note

Use filelib:is_regular/1 instead?

@uwiger Owner
uwiger added a note

Indeed. Fixed in subsequent commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ {ok, _} ->
+ ?DEBUG("Evaluating config script ~p~n", [Script]),
+ file:script(Script, [{'SCRIPT', Script}]);
+ _ ->
+ ?DEBUG("Consult config file ~p~n", [File]),
+ file:consult(File)
+ end
+ end.
local_opts([], Acc) ->
lists:reverse(Acc);
@uwiger

Indeed. Fixed in subsequent commit.

Please sign in to comment.
Something went wrong with that request. Please try again.