diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2016-09-15 08:18:24 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-15 08:18:24 -0400 |
commit | 6a8150e336e9f69b8cf49d62a4c99a3616cf1bf1 (patch) | |
tree | db33b567acc87a099469ec000b1c6257116679d2 /src | |
parent | 0e2b1a11b23658f06fb88076234eaad31605ff4c (diff) | |
parent | 2b6fa7a25e0acdee4ce2a452152b688f2df27dea (diff) |
Merge pull request #1326 from ddeboer/fix-preserve-ownership
Prevent crashing when `mv` warns and report warnings to the user instead.
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_file_utils.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/rebar_file_utils.erl b/src/rebar_file_utils.erl index 104c047..437780d 100644 --- a/src/rebar_file_utils.erl +++ b/src/rebar_file_utils.erl @@ -171,9 +171,14 @@ mv(Source, Dest) -> {unix, _} -> EscSource = rebar_utils:escape_chars(Source), EscDest = rebar_utils:escape_chars(Dest), - {ok, []} = rebar_utils:sh(?FMT("mv ~s ~s", [EscSource, EscDest]), - [{use_stdout, false}, abort_on_error]), - ok; + case rebar_utils:sh(?FMT("mv ~s ~s", [EscSource, EscDest]), + [{use_stdout, false}, abort_on_error]) of + {ok, []} -> + ok; + {ok, Warning} -> + ?WARN("mv: ~p", [Warning]), + ok + end; {win32, _} -> Cmd = case filelib:is_dir(Source) of true -> |