summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Thompson <andrew@hijacked.us>2010-10-28 00:39:42 -0400
committerAndrew Thompson <andrew@hijacked.us>2010-10-29 11:52:20 -0400
commit5158f9531dadd7dca21d8e9e369bfd23ec93fc2a (patch)
treeca8d219d1df450f3655ef10e091a14ead454fc28
parentff5a7982ebc9fdc8e3103f44c255118d3b26a131 (diff)
Stop clean from erroring if there's no .app file
If rebar tries to clean the .app file (because there's a .app.src file) and it doesn't exist (possibly because of a bad compile), don't fail.
-rw-r--r--src/rebar_otp_app.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/rebar_otp_app.erl b/src/rebar_otp_app.erl
index 0c30062..5987566 100644
--- a/src/rebar_otp_app.erl
+++ b/src/rebar_otp_app.erl
@@ -68,7 +68,15 @@ clean(_Config, File) ->
%% If the app file is a .app.src, delete the generated .app file
case rebar_app_utils:is_app_src(File) of
true ->
- file:delete(rebar_app_utils:app_src_to_app(File));
+ case file:delete(rebar_app_utils:app_src_to_app(File)) of
+ ok ->
+ ok;
+ {error, enoent} ->
+ %% The file not existing is OK, we can ignore the error.
+ ok;
+ Other ->
+ Other
+ end;
false ->
ok
end.