lib/agent/commands.js
function() {
  if (!watching) return;

  hooks.on('action', function(event, name) {
    if (event == 'stopped' || event == 'failed')
      remove('start', name);
  });

  hooks.on('trigger', function(event, name) {
    if (event == 'stopped')
      remove('watch', name);
  });
}
function() {
  if (!watching) return;

  hooks.on('action', function(event, name) {
    if (event == 'stopped' || event == 'failed')
      remove('start', name);
  });

  hooks.on('trigger', function(event, name) {
    if (event == 'stopped')
      remove('watch', name);
  });
}
function ( ) { if ( ! watching ) return ; hooks . on ( 'action' , function ( event , name ) { if ( event == 'stopped' || event == 'failed' ) remove ( 'start' , name ) ; } ) ; hooks . on ( 'trigger' , function ( event , name ) { if ( event == 'stopped' ) remove ( 'watch' , name ) ; } ) ; }
listen for new commands and add them to storage, in case the app crashes
listen for new commands and add them to storage in case the app crashes