8000 replace use of wildcard ** since it is not in <R16 Erlang by tsloughter · Pull Request #36 · erlware/relx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

replace use of wildcard ** since it is not in <R16 Erlang #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 13, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/rlx_prv_assembler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,12 @@ make_tar(State, Release, OutputDir) ->
{erts, ErtsDir},
{outdir, OutputDir}]) of
ok ->
TempDir = filename:join(OutputDir, integer_to_list(erlang:phash2(make_ref()))),
TempDir = ec_file:insecure_mkdtemp(),
try
update_tar(State, TempDir, OutputDir, Name, Vsn, ErtsVersion)
catch
E:R ->
file:del_dir(TempDir),
ec_file:remove(TempDir, [recursive]),
?RLX_ERROR({tar_generation_error, E, R})
end;
{ok, Module, Warnings} ->
Expand Down Expand Up @@ -484,7 +484,7 @@ update_tar(State, TempDir, OutputDir, Name, Vsn, ErtsVersion) ->
{"bin", filename:join([OutputDir, "bin"])}], [compressed]),
rlx_log:info(rlx_state:log(State),
"tarball ~s successfully created!~n", [TarFile]),
rlx_util:delete_dir(TempDir),
ec_file:remove(TempDir, [recursive]),
{ok, State}.

make_upfrom_script(State, Release, UpFrom) ->
Expand Down
16 changes: 1 addition & 15 deletions src/rlx_util.erl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
%%% @doc Trivial utility file to help handle common tasks
-module(rlx_util).

-export([delete_dir/1,
mkdir_p/1,
-export([mkdir_p/1,
to_binary/1,
to_string/1,
to_atom/1,
Expand All @@ -40,19 +39,6 @@
%%============================================================================
%% API
%%============================================================================
%% @doc Deletes non-empty directory
delete_dir(Path) ->
lists:foldr(fun(File, ok) ->
case filelib:is_dir(File) of
true ->
file:del_dir(File);
false ->
file:delete(File)
end
end, ok, filelib:wildcard(filename:join(Path, "**"))),
ok = file:del_dir(Path).


%% @doc Makes a directory including parent dirs if they are missing.
-spec mkdir_p(string()) -> ok | {error, Reason::file:posix()}.
mkdir_p(Path) ->
Expand Down
0