diff options
author | Tristan Sloughter <t@crashfast.com> | 2015-03-03 08:03:22 -0600 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2015-03-03 08:03:22 -0600 |
commit | 8ce1de1825964d20bf576d19929615542efda1ff (patch) | |
tree | cd7e2d8321b2d9e7404cc777a915e8c4de553661 /src | |
parent | 358046b0957fc7211f5dab7d76f0bc365d00c439 (diff) |
use rebar_file_utils:mv instead of copy for fetched source
Diffstat (limited to 'src')
-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 |