Browse Source

don't use rebar_dir function in bootstrap

pull/400/head
Tristan Sloughter 10 years ago
parent
commit
b4724009b5
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      bootstrap

+ 10
- 1
bootstrap View File

@ -122,7 +122,7 @@ symlink_or_copy(Source, Target) ->
{win32, _} -> {win32, _} ->
Source; Source;
_ -> _ ->
rebar_dir:make_relative_path(Source, Target)
make_relative_path(Source, Target)
end, end,
case file:make_symlink(Link, Target) of case file:make_symlink(Link, Target) of
ok -> ok ->
@ -133,6 +133,15 @@ symlink_or_copy(Source, Target) ->
cp_r([Source], Target) cp_r([Source], Target)
end. end.
make_relative_path(Source, Target) ->
do_make_relative_path(filename:split(Source), filename:split(Target)).
do_make_relative_path([H|T1], [H|T2]) ->
do_make_relative_path(T1, T2);
do_make_relative_path(Source, Target) ->
Base = lists:duplicate(max(length(Target) - 1, 0), ".."),
filename:join(Base ++ Source).
cp_r([], _Dest) -> cp_r([], _Dest) ->
ok; ok;
cp_r(Sources, Dest) -> cp_r(Sources, Dest) ->

Loading…
Cancel
Save