summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_prv_deps_tree.erl6
-rw-r--r--src/rebar_prv_update.erl28
-rw-r--r--src/rebar_relx.erl2
3 files changed, 20 insertions, 16 deletions
diff --git a/src/rebar_prv_deps_tree.erl b/src/rebar_prv_deps_tree.erl
index 04c4837..cefa60a 100644
--- a/src/rebar_prv_deps_tree.erl
+++ b/src/rebar_prv_deps_tree.erl
@@ -66,13 +66,13 @@ print_children(_, [], _, _) ->
print_children(Prefix, [{Name, Vsn, Source} | Rest], Dict, Verbose) ->
Prefix1 = case Rest of
[] ->
- io:format("~ts└─ ", [Prefix]),
+ io:format("~ts~ts", [Prefix, <<226,148,148,226,148,128,32>>]), %Binary for └─ utf8%
[Prefix, " "];
_ ->
- io:format("~ts├─ ", [Prefix]),
+ io:format("~ts~ts", [Prefix, <<226,148,156,226,148,128,32>>]), %Binary for ├─ utf8%
[Prefix, "│ "]
end,
- io:format("~ts─~ts (~ts)~n", [Name, Vsn, type(Source, Verbose)]),
+ io:format("~ts~ts~ts (~ts)~n", [Name, <<226,148,128>>, Vsn, type(Source, Verbose)]), %Binary for ─ utf8%
case dict:find(Name, Dict) of
{ok, Children} ->
print_children(Prefix1, lists:keysort(1, Children), Dict, Verbose),
diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
index 0491535..6637ebe 100644
--- a/src/rebar_prv_update.erl
+++ b/src/rebar_prv_update.erl
@@ -44,24 +44,28 @@ do(State) ->
TmpFile = filename:join(TmpDir, "packages.gz"),
Url = rebar_state:get(State, rebar_packages_cdn, ?DEFAULT_HEX_REGISTRY),
- {ok, _RequestId} = httpc:request(get, {Url, []},
- [], [{stream, TmpFile}, {sync, true}],
- rebar),
- {ok, Data} = file:read_file(TmpFile),
- Unzipped = zlib:gunzip(Data),
- ok = file:write_file(HexFile, Unzipped),
- ?INFO("Writing registry to ~s", [HexFile]),
- hex_to_index(State),
- ok
+ case httpc:request(get, {Url, []},
+ [], [{stream, TmpFile}, {sync, true}],
+ rebar) of
+ {ok, saved_to_file} ->
+ {ok, Data} = file:read_file(TmpFile),
+ Unzipped = zlib:gunzip(Data),
+ ok = file:write_file(HexFile, Unzipped),
+ ?INFO("Writing registry to ~s", [HexFile]),
+ hex_to_index(State),
+ {ok, State};
+ _ ->
+ ?PRV_ERROR(package_index_download)
+ end
catch
_E:C ->
?DEBUG("Error creating package index: ~p ~p", [C, erlang:get_stacktrace()]),
throw(?PRV_ERROR(package_index_write))
- end,
-
- {ok, State}.
+ end.
-spec format_error(any()) -> iolist().
+format_error(package_index_download) ->
+ "Failed to download package index.";
format_error(package_index_write) ->
"Failed to write package index.".
diff --git a/src/rebar_relx.erl b/src/rebar_relx.erl
index 699c780..36a24f0 100644
--- a/src/rebar_relx.erl
+++ b/src/rebar_relx.erl
@@ -18,7 +18,7 @@ do(Module, Command, Provider, State) ->
DepsDir = rebar_dir:deps_dir(State),
ProjectAppDirs = lists:delete(".", ?DEFAULT_PROJECT_APP_DIRS),
LibDirs = rebar_utils:filtermap(fun ec_file:exists/1,
- [?DEFAULT_CHECKOUTS_DIR, DepsDir | ProjectAppDirs]),
+ [rebar_dir:checkouts_dir(State), DepsDir | ProjectAppDirs]),
OutputDir = filename:join(rebar_dir:base_dir(State), ?DEFAULT_RELEASE_DIR),
AllOptions = string:join([Command | Options], " "),
Cwd = rebar_state:dir(State),