From 6db7e1a4e8e1689514171eeb0863e915e96ed508 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Mon, 23 May 2011 19:21:36 -0700 Subject: Make sure the cached repo dir exists and clone from the correct cached dir --- lib/jitterbug/Builder.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') 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 -- cgit 1.4.1