tasks/port-pick.js
function(callback) {
        var step = 0

        async.whilst(
          function() {
            return ++step <= pp.options.extra
          },
          function(callback) {
            pp.tryPorts = []
            var c = grunt.config.get('port-pick-' + step)

            // With multiple tasks, do not find a port that we've already found
            // in a previous task
            if(c) {
              callback()
              return
            }

            async.waterfall([
              pp.findPort,

              function(selectedPort, callback) {
                if(selectedPort === false)
                  grunt.fatal('No available port was found')

                grunt.config.set('port-pick-' + this.step, selectedPort)
                grunt.log.writeln( '>> '.green + 'port-pick-' + this.step + '=' +
                  selectedPort)

                callback()
              }.bind({step: step})
            ],
            function(err) {
              callback()
            })
          },
          function(err) {
            done()
          }
        )
      }
function(callback) {
        var step = 0

        async.whilst(
          function() {
            return ++step <= pp.options.extra
          },
          function(callback) {
            pp.tryPorts = []
            var c = grunt.config.get('port-pick-' + step)

            // With multiple tasks, do not find a port that we've already found
            // in a previous task
            if(c) {
              callback()
              return
            }

            async.waterfall([
              pp.findPort,

              function(selectedPort, callback) {
                if(selectedPort === false)
                  grunt.fatal('No available port was found')

                grunt.config.set('port-pick-' + this.step, selectedPort)
                grunt.log.writeln( '>> '.green + 'port-pick-' + this.step + '=' +
                  selectedPort)

                callback()
              }.bind({step: step})
            ],
            function(err) {
              callback()
            })
          },
          function(err) {
            done()
          }
        )
      }
function ( callback ) { var step = 0 async . whilst ( function ( ) { return ++ step <= pp . options . extra } , function ( callback ) { pp . tryPorts = [ ] var c = grunt . config . get ( 'port-pick-' + step ) // With multiple tasks, do not find a port that we've already found // in a previous task if ( c ) { callback ( ) return } async . waterfall ( [ pp . findPort , function ( selectedPort , callback ) { if ( selectedPort === false ) grunt . fatal ( 'No available port was found' ) grunt . config . set ( 'port-pick-' + this . step , selectedPort ) grunt . log . writeln ( '>> ' . green + 'port-pick-' + this . step + '=' + selectedPort ) callback ( ) } . bind ( { step : step } ) ] , function ( err ) { callback ( ) } ) } , function ( err ) { done ( ) } ) }
Set some configurations for extra ports template interpolation
Set some configurations for extra ports template interpolation