mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Make delete-deps a bit smarter
This commit is contained in:
parent
6efd2516ce
commit
8f9300124e
1 changed files with 15 additions and 1 deletions
|
@ -106,7 +106,12 @@ compile(Config, AppFile) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
'delete-deps'(Config, _) ->
|
'delete-deps'(Config, _) ->
|
||||||
rebar_file_utils:rm_rf(get_deps_dir()).
|
%% Delete all the available deps, if any
|
||||||
|
Deps = rebar_config:get_local(Config, deps, []),
|
||||||
|
{AvailableDeps, _} = find_deps(Deps),
|
||||||
|
[delete_dep(D) || D <- AvailableDeps],
|
||||||
|
ok.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%% ===================================================================
|
%% ===================================================================
|
||||||
|
@ -158,6 +163,15 @@ find_deps([Other | _Rest], _Acc) ->
|
||||||
[Other, rebar_utils:get_cwd()]).
|
[Other, rebar_utils:get_cwd()]).
|
||||||
|
|
||||||
|
|
||||||
|
delete_dep(D) ->
|
||||||
|
case filelib:is_dir(D#dep.dir) of
|
||||||
|
true ->
|
||||||
|
?INFO("Deleting dependency: ~s\n", [D#dep.dir]),
|
||||||
|
rebar_file_utils:rm_rf(D#dep.dir);
|
||||||
|
false ->
|
||||||
|
ok
|
||||||
|
end.
|
||||||
|
|
||||||
require_source_engine(Source) ->
|
require_source_engine(Source) ->
|
||||||
case source_engine_avail(Source) of
|
case source_engine_avail(Source) of
|
||||||
true ->
|
true ->
|
||||||
|
|
Loading…
Reference in a new issue