summaryrefslogtreecommitdiff
path: root/src/rebar_prv_install_deps.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_prv_install_deps.erl')
-rw-r--r--src/rebar_prv_install_deps.erl22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl
index 2a6048b..8bb394a 100644
--- a/src/rebar_prv_install_deps.erl
+++ b/src/rebar_prv_install_deps.erl
@@ -449,17 +449,29 @@ maybe_symlink_default(State, Profile, AppDir, AppInfo) ->
true ->
SymDir = filename:join([rebar_dir:deps_dir(State),
rebar_app_info:name(AppInfo)]),
- symlink_dep(AppDir, SymDir),
+ symlink_dep(State, AppDir, SymDir),
true;
false ->
false
end.
-
-symlink_dep(From, To) ->
- ?INFO("Linking ~s to ~s", [From, To]),
+symlink_dep(State, From, To) ->
filelib:ensure_dir(To),
- rebar_file_utils:symlink_or_copy(From, To).
+ case rebar_file_utils:symlink_or_copy(From, To) of
+ ok ->
+ RelativeFrom = make_relative_to_root(State, From),
+ RelativeTo = make_relative_to_root(State, To),
+ ?INFO("Linking ~s to ~s", [RelativeFrom, RelativeTo]),
+ ok;
+ exists ->
+ ok
+ end.
+
+make_relative_to_root(State, Path) when is_binary(Path) ->
+ make_relative_to_root(State, binary_to_list(Path));
+make_relative_to_root(State, Path) when is_list(Path) ->
+ Root = rebar_dir:root_dir(State),
+ rebar_dir:make_relative_path(Path, Root).
-spec parse_deps(binary(), list(), rebar_state:t(), list(), integer()) -> {[rebar_app_info:t()], [pkg_dep()]}.
parse_deps(DepsDir, Deps, State, Locks, Level) ->