summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorTristan Sloughter <t@crashfast.com>2015-05-07 18:37:53 -0500
committerTristan Sloughter <t@crashfast.com>2015-05-07 18:37:53 -0500
commitb4724009b5b8823b57c78c2cecac51875acb317a (patch)
treef632ff37bb40a53f803f0a44507821f201ea6b43 /bootstrap
parentc7281abb309283011bd2ef9cdf8da54ddd858aa1 (diff)
don't use rebar_dir function in bootstrap
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap11
1 files changed, 10 insertions, 1 deletions
diff --git a/bootstrap b/bootstrap
index 059bedf..d8c97a7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -122,7 +122,7 @@ symlink_or_copy(Source, Target) ->
{win32, _} ->
Source;
_ ->
- rebar_dir:make_relative_path(Source, Target)
+ make_relative_path(Source, Target)
end,
case file:make_symlink(Link, Target) of
ok ->
@@ -133,6 +133,15 @@ symlink_or_copy(Source, Target) ->
cp_r([Source], Target)
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) ->
ok;
cp_r(Sources, Dest) ->