summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Yakout <ali.yakout@ericsson.com>2012-03-30 15:18:35 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2012-03-30 16:58:07 +0200
commite0d9ca077369c78275fea09d5448451bfa7362cf (patch)
tree4d0f2166eaccf7f00742b54362e7bdb26da3a595
parent3f14c1c0927dbf90969b35d4c29305c2108f4e9b (diff)
asn1_compiler: only move hrl file if it exists
-rw-r--r--src/rebar_asn1_compiler.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/rebar_asn1_compiler.erl b/src/rebar_asn1_compiler.erl
index 612ae86..40129c9 100644
--- a/src/rebar_asn1_compiler.erl
+++ b/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.