Browse Source

ensure Dest exists before copying to it

pull/1763/head
Dmitry 7 years ago
parent
commit
b3f99aa42f
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/rebar_file_utils.erl

+ 2
- 2
src/rebar_file_utils.erl View File

@ -191,8 +191,8 @@ cp_r(Sources, Dest) ->
{unix, _} -> {unix, _} ->
EscSources = [rebar_utils:escape_chars(Src) || Src <- Sources], EscSources = [rebar_utils:escape_chars(Src) || Src <- Sources],
SourceStr = rebar_string:join(EscSources, " "), SourceStr = rebar_string:join(EscSources, " "),
{ok, []} = rebar_utils:sh(?FMT("cp -Rp ~ts \"~ts\"",
[SourceStr, rebar_utils:escape_double_quotes(Dest)]),
{ok, []} = rebar_utils:sh(?FMT("mkdir -p \"~ts\" && cp -Rp ~ts $_",
[rebar_utils:escape_double_quotes(Dest), SourceStr]),
[{use_stdout, false}, abort_on_error]), [{use_stdout, false}, abort_on_error]),
ok; ok;
{win32, _} -> {win32, _} ->

Loading…
Cancel
Save