diff options
author | Jonathan "Duke" Leto <jonathan@leto.net> | 2011-05-23 19:21:36 -0700 |
---|---|---|
committer | Jonathan "Duke" Leto <jonathan@leto.net> | 2011-05-23 19:21:36 -0700 |
commit | 6db7e1a4e8e1689514171eeb0863e915e96ed508 (patch) | |
tree | dbc2bc16bb89f4b301817281b292aa4899963fe5 /lib/jitterbug/Builder.pm | |
parent | Attempt to fix cloning again (diff) | |
download | jitterbug-6db7e1a4e8e1689514171eeb0863e915e96ed508.tar.gz |
Make sure the cached repo dir exists and clone from the correct cached dir
Diffstat (limited to '')
-rw-r--r-- | lib/jitterbug/Builder.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/jitterbug/Builder.pm b/lib/jitterbug/Builder.pm index 1f66343..6f882b4 100644 --- a/lib/jitterbug/Builder.pm +++ b/lib/jitterbug/Builder.pm @@ -110,6 +110,8 @@ sub _prepare_git_repo { # cached git repo, then checkout the correct sha1 debug("build_dir = $build_dir"); + mkdir $cached_repo_dir unless -d $cached_repo_dir; + unless ( -d catfile($cached_repo_dir,$name) ) { # If this is the first time, the repo won't exist yet # Clone it into our cached repo directory @@ -124,9 +126,9 @@ sub _prepare_git_repo { system("git fetch --prune"); chdir $pwd; - debug("Cloning from cached repo $cached_repo_dir into $build_dir"); + debug("Cloning from cached repo $cached_repo_dir/$name into $build_dir"); - _clone_into($cached_repo_dir, $build_dir); + _clone_into(catdir($cached_repo_dir,$name), $build_dir); chdir $build_dir; $self->sleep(1); # avoid race conditions |