packages/core/lib/misc/conditions.js
function({options}, succeed, skip) {
    return each(options.if_exec).call((cmd, next) => {
      this.log({
        message: `Nikita \`if_exec\`: ${cmd}`,
        level: 'DEBUG',
        module: 'nikita/misc/conditions'
      });
      return this.system.execute({
        cmd: cmd,
        relax: true,
        stderr_log: false,
        stdin_log: false,
        stdout_log: false
      }, function(err, {code}) {
        this.log({
          message: `Nikita \`if_exec\`: code is "${code}"`,
          level: 'INFO',
          module: 'nikita/misc/conditions'
        });
        if (code === 0) {
          return next();
        } else {
          return skip();
        }
      });
    }).next(succeed);
  }
function({options}, succeed, skip) {
    return each(options.if_exec).call((cmd, next) => {
      this.log({
        message: `Nikita \`if_exec\`: ${cmd}`,
        level: 'DEBUG',
        module: 'nikita/misc/conditions'
      });
      return this.system.execute({
        cmd: cmd,
        relax: true,
        stderr_log: false,
        stdin_log: false,
        stdout_log: false
      }, function(err, {code}) {
        this.log({
          message: `Nikita \`if_exec\`: code is "${code}"`,
          level: 'INFO',
          module: 'nikita/misc/conditions'
        });
        if (code === 0) {
          return next();
        } else {
          return skip();
        }
      });
    }).next(succeed);
  }
function ( { options } , succeed , skip ) { return each ( options . if_exec ) . call ( ( cmd , next ) => { this . log ( { message : ` \` \` ${ cmd } ` , level : 'DEBUG' , module : 'nikita/misc/conditions' } ) ; return this . system . execute ( { cmd : cmd , relax : true , stderr_log : false , stdin_log : false , stdout_log : false } , function ( err , { code } ) { this . log ( { message : ` \` \` ${ code } ` , level : 'INFO' , module : 'nikita/misc/conditions' } ) ; if ( code === 0 ) { return next ( ) ; } else { return skip ( ) ; } } ) ; } ) . next ( succeed ) ; }
The callback `succeed` is called if all the provided command were executed successfully otherwise the callback `skip` is called.
The callback succeed is called if all the provided command were executed successfully otherwise the callback skip is called .