From eeed5c58c19463cc10b153d2f637848d991b6871 Mon Sep 17 00:00:00 2001 From: nawa Date: Sun, 1 Dec 2013 16:45:48 +0800 Subject: [PATCH] skip clone exists dir --- lib/command_clone.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/command_clone.js b/lib/command_clone.js index d8dcd6a..03734f1 100644 --- a/lib/command_clone.js +++ b/lib/command_clone.js @@ -10,7 +10,11 @@ module.exports = function (task, exec, done) { repository: false, directory: false }); - + // repo directory exists + if(grunt.file.exists(options.directory ? options.directory : task.target)){ + grunt.log.ok(task.target+' exists!'); + return done(); // call next + } var args = ['clone']; // repo is the sole required option @@ -34,6 +38,8 @@ module.exports = function (task, exec, done) { // final argument is checkout directory (optional) if (options.directory) { args.push(options.directory); + }else{// use task target name + args.push(task.target); } // Add callback