Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Instead of restartign agner in rebar plugin, ensure agner is loaded.

  • Loading branch information...
commit 0edbd79a992008589e34e8824a1c598f5e37ed90 1 parent b9f9f88
@yrashk yrashk authored
Showing with 13 additions and 6 deletions.
  1. +13 −6 src/agner_rebar_plugin.erl
View
19 src/agner_rebar_plugin.erl
@@ -9,20 +9,27 @@
pre_compile(Config, AppFile).
'get-deps'(Config, AppFile) ->
- agner:start(),
+ ensure_agner_started(),
set_indices(Config),
agner_main:handle_command(fetch,[{app, AppFile},{version, "@master"},{addpath, false},
- {install, false},{build, false}]),
- agner:stop().
+ {install, false},{build, false}]).
pre_compile(Config, AppFile) ->
- agner:start(),
+ ensure_agner_started(),
set_indices(Config),
agner_main:handle_command(build,[{app, AppFile},{version, "@master"},{quiet, false},
{nofetch, true},
{addpath, false},
- {install, false}]),
- agner:stop().
+ {install, false}]).
set_indices(Config) ->
application:set_env(agner, indices, rebar_config:get_local(Config, agner_indices, [{github,"agner"}])).
+
+ensure_agner_started() ->
+ case proplists:get_value(agner, application:loaded_applications()) of
+ undefined ->
+ agner:start();
+ _ ->
+ ok %% already started
+ end.
+
Please sign in to comment.
Something went wrong with that request. Please try again.