diff options
author | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-03 09:01:38 -0600 |
---|---|---|
committer | Tristan Sloughter <tristan.sloughter@gmail.com> | 2015-03-03 09:01:38 -0600 |
commit | 46bd6fc59dd71065ce1986afb3b6a813739ba39d (patch) | |
tree | cd7e2d8321b2d9e7404cc777a915e8c4de553661 | |
parent | 358046b0957fc7211f5dab7d76f0bc365d00c439 (diff) | |
parent | 8ce1de1825964d20bf576d19929615542efda1ff (diff) |
Merge pull request #203 from tsloughter/mv
use rebar_file_utils:mv instead of copy for fetched source
-rw-r--r-- | src/rebar_fetch.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rebar_fetch.erl b/src/rebar_fetch.erl index 9c427df..b2ad211 100644 --- a/src/rebar_fetch.erl +++ b/src/rebar_fetch.erl @@ -38,7 +38,8 @@ download_source(AppDir, Source, State) -> ec_file:mkdir_p(AppDir1), code:del_path(filename:absname(filename:join(AppDir1, "ebin"))), ec_file:remove(filename:absname(AppDir1), [recursive]), - ok = ec_file:copy(TmpDir, filename:absname(AppDir1), [recursive]), + ?DEBUG("Moving checkout ~p to ~p", [TmpDir, filename:absname(AppDir1)]), + ok = rebar_file_utils:mv(TmpDir, filename:absname(AppDir1)), true; {tarball, File} -> Contents = filename:join(TmpDir, "contents"), @@ -49,7 +50,12 @@ download_source(AppDir, Source, State) -> [{cwd, Contents}, compressed]), code:del_path(filename:absname(filename:join(AppDir1, "ebin"))), ec_file:remove(filename:absname(AppDir1), [recursive]), - ok = ec_file:copy(Contents, filename:absname(AppDir1), [recursive]), + + ?DEBUG("Moving contents ~p to ~p", [Contents, filename:absname(AppDir1)]), + ok = rebar_file_utils:mv(Contents, filename:absname(AppDir1)), + + ?DEBUG("Removing tmp dir ~p", [TmpDir]), + ec_file:remove(TmpDir, [recursive]), true end catch |