anchor.diff:              end
       end.
   
  -init() ->
  -    {ok, Cwd} = file:get_cwd(),
  -    update_path(Cwd).
  +%% read rebar.config file and return the {deps, V}
  +deps(RebarFile) ->
  +    case file:consult(RebarFile) of
  +        {ok, Conf} ->
  +            case lists:keyfind(deps, 1, Conf) of
  +                {deps, Deps} ->
  +                    {ok, Deps};
  +                _ ->
  +                    {ok, []}
  +            end;
  +        Else ->
  +            Else
  +    end.
  +
  +do_clone_deps([]) ->
  +    ok;
  +do_clone_deps([{Name, _, Repo}|T]) ->
  +    Name1 = atom_to_list(Name),
  +    {Cmd, Url, Co} = Repo,
  +
  +    %% branch/tag it should checkout to
  +    Co1 = case Co of
  +              {_, V} -> V;
  +              Else -> Else
  +          end,
  +    Name2 = make_dep_name(Name1, Co1),
  +
  +    %% command options: clone url path/to/dep -b Branch/Tag
  +    Opts = ["clone", Url, get_path(Name2), "-b", Co1],
  +    io:format("dependency: ~s~n", [Name1]),
  +
  +    %% run the command
  +    exec(Cmd, Opts),
  +
  +    %% check dependencies of the dependency
  +    case deps(rebar_config_file(get_path(Name2))) of
  +        {ok, Deps} ->
  +            do_clone_deps(Deps);
  +        {error, _} ->
  +            ok
  +    end,
  +    do_clone_deps(T).
  
positive.code:             ok
      end,
      compile_app(Dir).
  
  compile_deps([]) ->
      ok;
  
negative.code: deps_ebin([H|T], Acc) ->
      deps_ebin(T, [filename:join([H, "ebin"])|Acc]).
  
  is_app_src(Filename) ->
      Filename =/= filename:rootname(Filename, ".app.src").
  
  