bin/run.js
function runKaba (opts, isVerbose)
{
    try
    {
        const logger = new Logger(kleur.bgYellow.black(" kaba "));
        logger.log("kaba started");
        const start = process.hrtime();
        const cliConfig = new CliConfig(opts);

        /** @type {Kaba} kaba */
        const kaba = require(`${process.cwd()}/kaba.js`);
        const buildConfig = kaba.getBuildConfig(cliConfig);

        const scss = new SassRunner(buildConfig, cliConfig);
        const webpack = new WebpackRunner(buildConfig);

        Promise.all([scss.run(), webpack.run()])
            .then(
                ([scssOk, webpackOk]) =>
                {
                    const failed = (false === scssOk || false === webpackOk);
                    const status = failed
                        ? kleur.red("failed")
                        : kleur.green("succeeded");

                    logger.logWithDuration(`kaba ${status}`, process.hrtime(start));

                    process.exit(failed ? 1 : 0);
                }
            )
            .catch(
                (...args) => console.log("something broke", args)
            );

        if (cliConfig.isWatch())
        {
            const exitCallback = () => {
                scss.stop();
                webpack.stop();
            };

            process.on("exit", exitCallback);
            process.on("SIGINT", exitCallback);
            process.on("SIGUSR1", exitCallback);
            process.on("SIGUSR2", exitCallback);
        }
    }
    catch (e)
    {
        if (/cannot find module.*?kaba\.js/i.test(e.message))
        {
            console.log(`${kleur.red("Error")}: Could not find ${kleur.yellow("kaba.js")}`);
        }
        else
        {
            console.log(kleur.red(`Run Error: ${e.message}`));
        }

        if (isVerbose)
        {
            console.error(e);
        }

        process.exit(1);
    }
}
function runKaba (opts, isVerbose)
{
    try
    {
        const logger = new Logger(kleur.bgYellow.black(" kaba "));
        logger.log("kaba started");
        const start = process.hrtime();
        const cliConfig = new CliConfig(opts);

        /** @type {Kaba} kaba */
        const kaba = require(`${process.cwd()}/kaba.js`);
        const buildConfig = kaba.getBuildConfig(cliConfig);

        const scss = new SassRunner(buildConfig, cliConfig);
        const webpack = new WebpackRunner(buildConfig);

        Promise.all([scss.run(), webpack.run()])
            .then(
                ([scssOk, webpackOk]) =>
                {
                    const failed = (false === scssOk || false === webpackOk);
                    const status = failed
                        ? kleur.red("failed")
                        : kleur.green("succeeded");

                    logger.logWithDuration(`kaba ${status}`, process.hrtime(start));

                    process.exit(failed ? 1 : 0);
                }
            )
            .catch(
                (...args) => console.log("something broke", args)
            );

        if (cliConfig.isWatch())
        {
            const exitCallback = () => {
                scss.stop();
                webpack.stop();
            };

            process.on("exit", exitCallback);
            process.on("SIGINT", exitCallback);
            process.on("SIGUSR1", exitCallback);
            process.on("SIGUSR2", exitCallback);
        }
    }
    catch (e)
    {
        if (/cannot find module.*?kaba\.js/i.test(e.message))
        {
            console.log(`${kleur.red("Error")}: Could not find ${kleur.yellow("kaba.js")}`);
        }
        else
        {
            console.log(kleur.red(`Run Error: ${e.message}`));
        }

        if (isVerbose)
        {
            console.error(e);
        }

        process.exit(1);
    }
}
function runKaba ( opts , isVerbose ) { try { const logger = new Logger ( kleur . bgYellow . black ( " kaba " ) ) ; logger . log ( "kaba started" ) ; const start = process . hrtime ( ) ; const cliConfig = new CliConfig ( opts ) ; /** @type {Kaba} kaba */ const kaba = require ( ` ${ process . cwd ( ) } ` ) ; const buildConfig = kaba . getBuildConfig ( cliConfig ) ; const scss = new SassRunner ( buildConfig , cliConfig ) ; const webpack = new WebpackRunner ( buildConfig ) ; Promise . all ( [ scss . run ( ) , webpack . run ( ) ] ) . then ( ( [ scssOk , webpackOk ] ) => { const failed = ( false === scssOk || false === webpackOk ) ; const status = failed ? kleur . red ( "failed" ) : kleur . green ( "succeeded" ) ; logger . logWithDuration ( ` ${ status } ` , process . hrtime ( start ) ) ; process . exit ( failed ? 1 : 0 ) ; } ) . catch ( ( ... args ) => console . log ( "something broke" , args ) ) ; if ( cliConfig . isWatch ( ) ) { const exitCallback = ( ) => { scss . stop ( ) ; webpack . stop ( ) ; } ; process . on ( "exit" , exitCallback ) ; process . on ( "SIGINT" , exitCallback ) ; process . on ( "SIGUSR1" , exitCallback ) ; process . on ( "SIGUSR2" , exitCallback ) ; } } catch ( e ) { if ( / cannot find module.*?kaba\.js / i . test ( e . message ) ) { console . log ( ` ${ kleur . red ( "Error" ) } ${ kleur . yellow ( "kaba.js" ) } ` ) ; } else { console . log ( kleur . red ( ` ${ e . message } ` ) ) ; } if ( isVerbose ) { console . error ( e ) ; } process . exit ( 1 ) ; } }
Main kaba function

@param {CliConfigArguments} opts
@param {boolean} isVerbose
Main kaba function