tasks/batch_git_clone.js
function performCmd(repoURL, path){

      var deferred = Q.defer();

      if(errorOccured === true){
        deferred.reject();
        return deferred.promise;
      }

      if(grunt.file.isDir(path) && options.overWrite === false){
        deferred.resolve(false);
        return deferred.promise;
      }

      var msg = '---> Cloning "'+repoURL+'" ==> '+path;
      var execString = 'git clone '+repoURL+' '+path;

      if(options.depth > 0){
        execString += ' --depth '+options.depth;
      }

      if(options.postClone !== ''){
        msg += ' THEN executing "'+options.postClone+'"';
        execString += ' && cd '+path+' && '+options.postClone;
      }

      grunt.log.writeln(msg);

      var child = exec(execString);

      // add events for logging
      child.stdout.on('data', function(data) {
        grunt.log.writeln(data);
      });
      child.stderr.on('data', function(data) {
        grunt.verbose.writeln(data);
      });
      child.on('close', function(code) {
        deferred.resolve(true);
      });

      return deferred.promise;

    }
function performCmd(repoURL, path){

      var deferred = Q.defer();

      if(errorOccured === true){
        deferred.reject();
        return deferred.promise;
      }

      if(grunt.file.isDir(path) && options.overWrite === false){
        deferred.resolve(false);
        return deferred.promise;
      }

      var msg = '---> Cloning "'+repoURL+'" ==> '+path;
      var execString = 'git clone '+repoURL+' '+path;

      if(options.depth > 0){
        execString += ' --depth '+options.depth;
      }

      if(options.postClone !== ''){
        msg += ' THEN executing "'+options.postClone+'"';
        execString += ' && cd '+path+' && '+options.postClone;
      }

      grunt.log.writeln(msg);

      var child = exec(execString);

      // add events for logging
      child.stdout.on('data', function(data) {
        grunt.log.writeln(data);
      });
      child.stderr.on('data', function(data) {
        grunt.verbose.writeln(data);
      });
      child.on('close', function(code) {
        deferred.resolve(true);
      });

      return deferred.promise;

    }
function performCmd ( repoURL , path ) { var deferred = Q . defer ( ) ; if ( errorOccured === true ) { deferred . reject ( ) ; return deferred . promise ; } if ( grunt . file . isDir ( path ) && options . overWrite === false ) { deferred . resolve ( false ) ; return deferred . promise ; } var msg = '---> Cloning "' + repoURL + '" ==> ' + path ; var execString = 'git clone ' + repoURL + ' ' + path ; if ( options . depth > 0 ) { execString += ' --depth ' + options . depth ; } if ( options . postClone !== '' ) { msg += ' THEN executing "' + options . postClone + '"' ; execString += ' && cd ' + path + ' && ' + options . postClone ; } grunt . log . writeln ( msg ) ; var child = exec ( execString ) ; // add events for logging child . stdout . on ( 'data' , function ( data ) { grunt . log . writeln ( data ) ; } ) ; child . stderr . on ( 'data' , function ( data ) { grunt . verbose . writeln ( data ) ; } ) ; child . on ( 'close' , function ( code ) { deferred . resolve ( true ) ; } ) ; return deferred . promise ; }
performs the clone command
performs the clone command