diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_install_deps.erl | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/rebar_prv_install_deps.erl b/src/rebar_prv_install_deps.erl index 1884a9c..3612303 100644 --- a/src/rebar_prv_install_deps.erl +++ b/src/rebar_prv_install_deps.erl @@ -395,14 +395,8 @@ maybe_fetch(AppInfo, Profile, Upgrade, Seen, State) -> false -> case fetch_app(AppInfo, AppDir, State) of true -> - case needs_symlinking(State, Profile) of - true -> - SymDir = filename:join([rebar_dir:deps_dir(State), rebar_app_info:name(AppInfo)]), - symlink_dep(AppDir, SymDir), - {true, AppInfo}; - false -> - {true, AppInfo} - end; + maybe_symlink_default(State, Profile, AppDir, AppInfo), + {true, AppInfo}; Other -> {Other, AppInfo} end; @@ -417,6 +411,7 @@ maybe_fetch(AppInfo, Profile, Upgrade, Seen, State) -> %% Preserve the state we created with overrides AppState = rebar_app_info:state(AppInfo), AppInfo2 = rebar_app_info:state(AppInfo1, AppState), + maybe_symlink_default(State, Profile, AppDir, AppInfo2), case sets:is_element(rebar_app_info:name(AppInfo), Seen) of true -> {false, AppInfo2}; @@ -445,6 +440,18 @@ needs_symlinking(State, Profile) -> false end. +maybe_symlink_default(State, Profile, AppDir, AppInfo) -> + case needs_symlinking(State, Profile) of + true -> + SymDir = filename:join([rebar_dir:deps_dir(State), + rebar_app_info:name(AppInfo)]), + symlink_dep(AppDir, SymDir), + true; + false -> + false + end. + + symlink_dep(From, To) -> ?INFO("Linking ~s to ~s", [From, To]), filelib:ensure_dir(To), |