From e0d9ca077369c78275fea09d5448451bfa7362cf Mon Sep 17 00:00:00 2001 From: Ali Yakout Date: Fri, 30 Mar 2012 15:18:35 +0200 Subject: asn1_compiler: only move hrl file if it exists --- src/rebar_asn1_compiler.erl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') 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. -- cgit v1.1