asn1_compiler: only move hrl file if it exists

This commit is contained in:
Ali Yakout 2012-03-30 15:18:35 +02:00 committed by Tuncer Ayaz
parent 3f14c1c092
commit e0d9ca0773

View file

@ -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.