Merge pull request #4 from cdent/git-clone-dir-safety

safely handle git clone from alien directory
This commit is contained in:
Sean Dague 2014-05-29 06:34:10 -04:00
commit 2a1e2ee1ff
1 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,9 @@ function git_clone {
local GIT_DEST=$2
local GIT_REF=$3
# Avoid git exiting when in some other dir than the typical /home/stack
cd $(dirname $GIT_DEST)
# do a full clone only if the directory doesn't exist
if [[ ! -d $GIT_DEST ]]; then
git_timed clone $GIT_REMOTE $GIT_DEST