diff options
author | Tristan Sloughter <t@crashfast.com> | 2014-12-05 17:03:05 -0600 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2014-12-05 17:27:37 -0600 |
commit | 7cb22e469817f4d54220192997c189a89525f373 (patch) | |
tree | 9be1d4652835b811224ce7b685f5a82a8c47f1a4 /src | |
parent | 228e96c9eb296d236ec23dfc1ee0e6b5236c4a30 (diff) |
only create the apps dir after successful fetch
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_fetch.erl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rebar_fetch.erl b/src/rebar_fetch.erl index 2df892c..a1b3476 100644 --- a/src/rebar_fetch.erl +++ b/src/rebar_fetch.erl @@ -28,14 +28,15 @@ download_source(AppDir, Source) -> Module = get_resource_type(Source), TmpDir = ec_file:insecure_mkdtemp(), AppDir1 = ec_cnv:to_list(AppDir), - ec_file:mkdir_p(AppDir1), case Module:download(TmpDir, Source) of {ok, _} -> + 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]), true; {tarball, File} -> + ec_file:mkdir_p(AppDir1), ok = erl_tar:extract(File, [{cwd, TmpDir} ,compressed]), BaseName = filename:basename(AppDir1), |