diff options
-rw-r--r-- | src/rebar_file_utils.erl | 2 | ||||
-rw-r--r-- | src/rebar_prv_edoc.erl | 3 | ||||
-rw-r--r-- | src/rebar_prv_install_deps.erl | 22 | ||||
-rw-r--r-- | src/rebar_prv_plugins_upgrade.erl | 5 |
4 files changed, 24 insertions, 8 deletions
diff --git a/src/rebar_file_utils.erl b/src/rebar_file_utils.erl index da58c00..07c63f1 100644 --- a/src/rebar_file_utils.erl +++ b/src/rebar_file_utils.erl @@ -73,7 +73,7 @@ symlink_or_copy(Source, Target) -> ok -> ok; {error, eexist} -> - ok; + exists; {error, _} -> case os:type() of {win32, _} -> diff --git a/src/rebar_prv_edoc.erl b/src/rebar_prv_edoc.erl index 14df269..e7048b6 100644 --- a/src/rebar_prv_edoc.erl +++ b/src/rebar_prv_edoc.erl @@ -24,7 +24,8 @@ init(State) -> {example, "rebar3 edoc"}, {short_desc, "Generate documentation using edoc."}, {desc, "Generate documentation using edoc."}, - {opts, []}])), + {opts, []}, + {profiles, [docs]}])), {ok, State1}. -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. 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) -> diff --git a/src/rebar_prv_plugins_upgrade.erl b/src/rebar_prv_plugins_upgrade.erl index 02c185f..f67b7dc 100644 --- a/src/rebar_prv_plugins_upgrade.erl +++ b/src/rebar_prv_plugins_upgrade.erl @@ -97,7 +97,10 @@ find(Plugin, [Plugin1 | Plugins]) when is_tuple(Plugin1) -> Plugin1; false -> find(Plugin, Plugins) - end. + end; +find(Plugin, [_Plugin | Plugins]) -> + find(Plugin, Plugins). + build_plugin(AppInfo, Apps, State) -> Providers = rebar_state:providers(State), |