tasks/forever-task.js
function stopOnProcess(index) {
  log( 'Attempting to stop ' + index + '...' );

  done = this.async();
  findProcessWithIndex( index, function(process) {
    if( typeof process !== 'undefined' ) {
      log( forever.format(true,[process]) );

      forever.stop( index )
        .on('stop', function() {
          done();
        })
        .on('error', function(message) {
          error( 'Error stopping ' + index + '. [REASON] :: ' + message );
          done(false);
        });
    }
    else {
      gruntRef.warn( index + ' not found in list of processes in forever.' );
      done();
    }
  });
}
function stopOnProcess(index) {
  log( 'Attempting to stop ' + index + '...' );

  done = this.async();
  findProcessWithIndex( index, function(process) {
    if( typeof process !== 'undefined' ) {
      log( forever.format(true,[process]) );

      forever.stop( index )
        .on('stop', function() {
          done();
        })
        .on('error', function(message) {
          error( 'Error stopping ' + index + '. [REASON] :: ' + message );
          done(false);
        });
    }
    else {
      gruntRef.warn( index + ' not found in list of processes in forever.' );
      done();
    }
  });
}
function stopOnProcess ( index ) { log ( 'Attempting to stop ' + index + '...' ) ; done = this . async ( ) ; findProcessWithIndex ( index , function ( process ) { if ( typeof process !== 'undefined' ) { log ( forever . format ( true , [ process ] ) ) ; forever . stop ( index ) . on ( 'stop' , function ( ) { done ( ) ; } ) . on ( 'error' , function ( message ) { error ( 'Error stopping ' + index + '. [REASON] :: ' + message ) ; done ( false ) ; } ) ; } else { gruntRef . warn ( index + ' not found in list of processes in forever.' ) ; done ( ) ; } } ) ; }
Attempts to stop a process previously started associated with index.
@param  {String} index Filename associated with previously started process.
Attempts to stop a process previously started associated with index .