diff options
-rw-r--r-- | rebar.config | 2 | ||||
-rw-r--r-- | rebar.lock | 2 | ||||
-rw-r--r-- | src/rebar_prv_deps_tree.erl | 6 | ||||
-rw-r--r-- | src/rebar_prv_update.erl | 28 | ||||
-rw-r--r-- | src/rebar_relx.erl | 2 |
5 files changed, 22 insertions, 18 deletions
diff --git a/rebar.config b/rebar.config index 6eed68f..eb3dd78 100644 --- a/rebar.config +++ b/rebar.config @@ -8,7 +8,7 @@ {getopt, "0.8.2"}, {bbmustache, "1.0.4"}, {relx, "3.7.1"}, - {cf, "0.1.2"}]}. + {cf, "0.1.3"}]}. {escript_name, rebar3}. {escript_emu_args, "%%! +sbtu +A0\n"}. @@ -1,6 +1,6 @@ [{<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.0.4">>},0}, {<<"certifi">>,{pkg,<<"certifi">>,<<"0.1.1">>},0}, - {<<"cf">>,{pkg,<<"cf">>,<<"0.1.2">>},0}, + {<<"cf">>,{pkg,<<"cf">>,<<"0.1.3">>},0}, {<<"erlware_commons">>,{pkg,<<"erlware_commons">>,<<"0.16.0">>},0}, {<<"getopt">>,{pkg,<<"getopt">>,<<"0.8.2">>},0}, {<<"providers">>,{pkg,<<"providers">>,<<"1.5.0">>},0}, 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), |