summaryrefslogtreecommitdiff
path: root/src/rebar_erlc_compiler.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-07-07 00:20:42 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-07-07 00:20:42 -0400
commit5fe10193c44f4579b3c1adf62d43251383b73f73 (patch)
tree04dfec24dc917cdf03a45108ce5a2643c250346e /src/rebar_erlc_compiler.erl
parentdf45aa6d48b15fcd9b5a62b0c4fef17ddae3d8ee (diff)
parentb6b32fc64efb3b8a48f144fa850bfef923f66d45 (diff)
Merge pull request #592 from tsloughter/mibs
ensure necessary directories exist to compile mibs files
Diffstat (limited to 'src/rebar_erlc_compiler.erl')
-rw-r--r--src/rebar_erlc_compiler.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index b9072a3..87cf352 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -404,10 +404,13 @@ target_base(OutDir, Source) ->
-spec compile_mib(file:filename(), file:filename(),
rebar_state:t()) -> 'ok'.
compile_mib(Source, Target, Config) ->
+ Dir = rebar_state:dir(Config),
ok = filelib:ensure_dir(Target),
- ok = filelib:ensure_dir(filename:join("include", "dummy.hrl")),
- Opts = [{outdir, "priv/mibs"}, {i, ["priv/mibs"]}] ++
+ ok = filelib:ensure_dir(filename:join([Dir, "include", "dummy.hrl"])),
+ Opts = [{outdir, filename:join([Dir, "priv", "mibs"])}
+ ,{i, [filename:join([Dir, "priv", "mibs"])]}] ++
rebar_state:get(Config, mib_opts, []),
+
case snmpc:compile(Source, Opts) of
{ok, _} ->
Mib = filename:rootname(Target),