src/yake/main.js
function tryRunTask(args, collection)
{
    let nameOfTaskToRun = 'default';
    const a = args.getArgs();

    if (a.length > 0)
    {
        nameOfTaskToRun = a[0];
    }

    const firstTask = collection.getByName(nameOfTaskToRun);

    if (firstTask === undefined)
    {
        // console.log('ERROR');
        ERROR.raiseError(`task ${nameOfTaskToRun} not found`);
    }
    TASKS.invokeTask(collection, firstTask);
    // console.log(chalk.white.bold(`${firstTask.name()} - completed `) + chalk.green.bold('OK'));
}
function tryRunTask(args, collection)
{
    let nameOfTaskToRun = 'default';
    const a = args.getArgs();

    if (a.length > 0)
    {
        nameOfTaskToRun = a[0];
    }

    const firstTask = collection.getByName(nameOfTaskToRun);

    if (firstTask === undefined)
    {
        // console.log('ERROR');
        ERROR.raiseError(`task ${nameOfTaskToRun} not found`);
    }
    TASKS.invokeTask(collection, firstTask);
    // console.log(chalk.white.bold(`${firstTask.name()} - completed `) + chalk.green.bold('OK'));
}
function tryRunTask ( args , collection ) { let nameOfTaskToRun = 'default' ; const a = args . getArgs ( ) ; if ( a . length > 0 ) { nameOfTaskToRun = a [ 0 ] ; } const firstTask = collection . getByName ( nameOfTaskToRun ) ; if ( firstTask === undefined ) { // console.log('ERROR'); ERROR . raiseError ( ` ${ nameOfTaskToRun } ` ) ; } TASKS . invokeTask ( collection , firstTask ) ; // console.log(chalk.white.bold(`${firstTask.name()} - completed `) + chalk.green.bold('OK')); }
Looks in the CliArguments parameter and if any strings are found tries to execute those
as task names and of course the prerequisites

@param      {CliArguments}               args -   The arguments
@param      {TaskCollection}             collection - The collection of tasks from which original taska and
prerequisistes will come
Looks in the CliArguments parameter and if any strings are found tries to execute those as task names and of course the prerequisites