Permalink
Browse files

asn1_compiler: only move hrl file if it exists

  • Loading branch information...
1 parent 3f14c1c commit e0d9ca077369c78275fea09d5448451bfa7362cf @ayakout ayakout committed with tuncer Mar 30, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/rebar_asn1_compiler.erl
View
8 src/rebar_asn1_compiler.erl
@@ -58,8 +58,12 @@ compile_asn1(Source, Target, Config) ->
ok ->
Asn1 = filename:basename(Source, ".asn1"),
HrlFile = filename:join("src", Asn1 ++ ".hrl"),
- ok = rebar_file_utils:mv(HrlFile, "include"),
- ok;
+ case filelib:is_regular(HrlFile) of
+ true ->
+ ok = rebar_file_utils:mv(HrlFile, "include");
+ false ->
+ ok
+ end;
{error, _Reason} ->
?FAIL
end.

0 comments on commit e0d9ca0

Please sign in to comment.