diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-07-04 19:40:01 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-07-04 19:40:01 -0400 |
commit | 6fdbea7094c7582635b3c809989497ec9dfaf137 (patch) | |
tree | c9ec81d2d07708263fc2cc802cb67711f06cdec0 | |
parent | 9fdab2cb1bd9f9098567effaf2337f043320b601 (diff) | |
parent | 80bfb0dd29de21c49bdde1ed0a23a51fb10b7a9a (diff) |
Merge pull request #588 from Taure/fix-robocopy-case
Changed cases on robocopy so it uses variables in a better way
-rw-r--r-- | src/rebar_file_utils.erl | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/rebar_file_utils.erl b/src/rebar_file_utils.erl index 073d189..b4cdc27 100644 --- a/src/rebar_file_utils.erl +++ b/src/rebar_file_utils.erl @@ -155,17 +155,17 @@ mv(Source, Dest) -> [{use_stdout, false}, abort_on_error]), ok; {win32, _} -> - case filelib:is_dir(Source) of - true -> - Cmd = ?FMT("robocopy /move /s \"~s\" \"~s\" 1> nul", - [filename:nativename(Source), - filename:nativename(Dest)]); - false -> - Cmd = ?FMT("robocopy /move /s \"~s\" \"~s\" \"~s\" 1> nul", - [filename:nativename(filename:dirname(Source)), - filename:nativename(Dest), - filename:basename(Source)]) - end, + Cmd = case filelib:is_dir(Source) of + true -> + ?FMT("robocopy /move /s \"~s\" \"~s\" 1> nul", + [filename:nativename(Source), + filename:nativename(Dest)]); + false -> + ?FMT("robocopy /move /s \"~s\" \"~s\" \"~s\" 1> nul", + [filename:nativename(filename:dirname(Source)), + filename:nativename(Dest), + filename:basename(Source)]) + end, Res = rebar_utils:sh(Cmd, [{use_stdout, false}, return_on_error]), case win32_ok(Res) of @@ -257,17 +257,17 @@ delete_each_dir_win32([Dir | Rest]) -> xcopy_win32(Source,Dest)-> %% "xcopy \"~s\" \"~s\" /q /y /e 2> nul", Chanegd to robocopy to %% handle long names. May have issues with older windows. - case filelib:is_dir(Source) of - true -> - Cmd = ?FMT("robocopy \"~s\" \"~s\" /e /is 1> nul", - [filename:nativename(Source), - filename:nativename(Dest)]); - false -> - Cmd = ?FMT("robocopy \"~s\" \"~s\" \"~s\" /e /is 1> nul", - [filename:nativename(filename:dirname(Source)), - filename:nativename(Dest), - filename:basename(Source)]) - end, + Cmd = case filelib:is_dir(Source) of + true -> + ?FMT("robocopy \"~s\" \"~s\" /e /is 1> nul", + [filename:nativename(Source), + filename:nativename(Dest)]); + false -> + ?FMT("robocopy \"~s\" \"~s\" \"~s\" /e /is 1> nul", + [filename:nativename(filename:dirname(Source)), + filename:nativename(Dest), + filename:basename(Source)]) + end, Res = rebar_utils:sh(Cmd, [{use_stdout, false}, return_on_error]), case win32_ok(Res) of |