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