lib/generate.js
function(commands) {
		if (!commands || (commands.length === 0)) {
			return true;
		}
		if (typeof commands === 'string') {
			commands = [commands];
		}
		return commands.every(function(command) {
			logger.info('Starting command "%s"...', command);
			var result = exec(
				command,
				{cwd: path.resolve('.')}
			);
			if (result.status !== 0) { // error
				logger.error('Error: "%s" - "%s"', result.stdout, result.stderr.trim());
				return false;
			}
			logger.success('Command successfully finished');
			logger.log('Command result: "%s"', result.stdout);
			return true;
		});
	}
function(commands) {
		if (!commands || (commands.length === 0)) {
			return true;
		}
		if (typeof commands === 'string') {
			commands = [commands];
		}
		return commands.every(function(command) {
			logger.info('Starting command "%s"...', command);
			var result = exec(
				command,
				{cwd: path.resolve('.')}
			);
			if (result.status !== 0) { // error
				logger.error('Error: "%s" - "%s"', result.stdout, result.stderr.trim());
				return false;
			}
			logger.success('Command successfully finished');
			logger.log('Command result: "%s"', result.stdout);
			return true;
		});
	}
function ( commands ) { if ( ! commands || ( commands . length === 0 ) ) { return true ; } if ( typeof commands === 'string' ) { commands = [ commands ] ; } return commands . every ( function ( command ) { logger . info ( 'Starting command "%s"...' , command ) ; var result = exec ( command , { cwd : path . resolve ( '.' ) } ) ; if ( result . status !== 0 ) { // error logger . error ( 'Error: "%s" - "%s"' , result . stdout , result . stderr . trim ( ) ) ; return false ; } logger . success ( 'Command successfully finished' ) ; logger . log ( 'Command result: "%s"' , result . stdout ) ; return true ; } ) ; }
Function to start before and after commands
Function to start before and after commands