diff options
Diffstat (limited to 'src/rebar_resource_v2.erl')
-rw-r--r-- | src/rebar_resource_v2.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/rebar_resource_v2.erl b/src/rebar_resource_v2.erl index f032f6e..b7ee760 100644 --- a/src/rebar_resource_v2.erl +++ b/src/rebar_resource_v2.erl @@ -61,14 +61,20 @@ find_resource(Type, Resources) -> find_resource_state(Type, Resources) -> case lists:keyfind(Type, #resource.type, Resources) of - false -> + false -> {error, not_found}; #resource{state=State} -> State end. -format_source({pkg, Name, Vsn, _Hash, _}) -> {pkg, Name, Vsn}; -format_source(Source) -> Source. +format_source(AppInfo) -> + Name = rebar_app_info:name(AppInfo), + case rebar_app_info:source(AppInfo) of + {pkg, _Name, Vsn, _Hash, _} -> + io_lib:format("~ts v~s", [Name, Vsn]); + Source -> + io_lib:format("~ts (from ~p)", [Name, Source]) + end. lock(AppInfo, State) -> resource_run(lock, rebar_app_info:source(AppInfo), [AppInfo], State). |