code: function() {
        var i = 0;
        grunt.log.writeln( 'Ensuring directories:' );
  
        var ensureDir = function( dir ) {
          grunt.log.ok( options.remoteDir + dir );
  
          if ( directoriesChecked.indexOf( dir ) > -1 && ((i + 1) < dirs.length) ) {
            directoriesChecked.push( dir );
            i += 1;
            ensureDir( dirs[ i ] );
          } else if ( i >= dirs.length ) {
            uploadFiles();
          } else {
            directoriesChecked.push( dir );
            client
              .raw( 'mkdir -p "' + options.remoteDir + dir + '"' )
              .exec(function( err, res ) {
                if ( err ) {
                  grunt.log.error( err );
                }
  
                if ( (i + 1) < dirs.length ) {
                   i += 1;
                  ensureDir( dirs[ i ] );
                } else {
                  uploadFiles();
                }
              });
          }
        };
  
        if ( dirs.length > 0 ) {
          ensureDir( dirs[0] );
        }
      }
docs: ============================================================================================= ENSURE DIRECTORY EXISTS =============================================================================================