summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Wayne Norton <norton@alum.mit.edu>2010-12-27 11:04:47 +0900
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2010-12-27 13:29:53 +0100
commita529577b740d5a0a8f48703d4d66248099155de0 (patch)
tree2c0369423967dcd740de99b0260f5a57f4878157
parent008dcb8542ed4bb1aed98e3fed92c55b0770d132 (diff)
Remove erlc target after fail_on_warning failure
Prevent overlooking a compilation warning by removing the target beam file after fail_on_warning failure.
-rw-r--r--src/rebar_erlc_compiler.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index e69dea9..13c2eaa 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -228,6 +228,8 @@ internal_erl_compile(Source, Config, Outdir, ErlOpts) ->
%% We got at least one warning -- if fail_on_warning is in options, fail
case lists:member(fail_on_warning, Opts) of
true ->
+ %% remove target to prevent overlooking this failure
+ ok = file:delete(Target),
?FAIL;
false ->
ok