summaryrefslogtreecommitdiff
path: root/src/rebar_fetch.erl
diff options
context:
space:
mode:
authoromarkj <omarkj@gmail.com>2014-11-03 13:58:58 -0800
committeromarkj <omarkj@gmail.com>2014-11-03 13:58:58 -0800
commita1d030c9649526422f58e0fb5dae9d33564b395a (patch)
treefeb95f0fec3421ed876e1802584430e18e29f73f /src/rebar_fetch.erl
parent58f4019fa62a73e335967870f6605182d7386830 (diff)
parenta3ec3a3424dd47e9687d0d2960ef2d3cba6a8f5c (diff)
add help
Diffstat (limited to 'src/rebar_fetch.erl')
-rw-r--r--src/rebar_fetch.erl10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/rebar_fetch.erl b/src/rebar_fetch.erl
index 6b31f6c..0a90848 100644
--- a/src/rebar_fetch.erl
+++ b/src/rebar_fetch.erl
@@ -49,14 +49,16 @@ lock_source(_AppDir, Source) ->
download_source(AppDir, Source) ->
TmpDir = ec_file:insecure_mkdtemp(),
AppDir1 = ec_cnv:to_list(AppDir),
+ ec_file:mkdir_p(AppDir1),
case download_source_tmp(TmpDir, Source) of
{ok, _} ->
- ec_file:mkdir_p(AppDir1),
ok = ec_file:copy(TmpDir, filename:absname(AppDir1), [recursive]);
{tarball, File} ->
- ok = erl_tar:extract(File, [{cwd,
- (filename:dirname(filename:absname(AppDir1)))}
- ,compressed])
+ ok = erl_tar:extract(File, [{cwd, TmpDir}
+ ,compressed]),
+ BaseName = filename:basename(AppDir1),
+ [FromDir] = filelib:wildcard(filename:join(TmpDir, BaseName++"-*")),
+ ec_file:copy(FromDir, AppDir1, [recursive])
end.
download_source_tmp(TmpDir, {p4, Url}) ->