src/hooks/HooksRunner.js
function runScriptsSerially (scripts, context) {
    if (scripts.length === 0) {
        events.emit('verbose', 'No scripts found for hook "' + context.hook + '".');
    }
    return scripts.reduce(function (prevScriptPromise, nextScript) {
        return prevScriptPromise.then(function () {
            return runScript(nextScript, context);
        });
    }, Promise.resolve());
}
function runScriptsSerially (scripts, context) {
    if (scripts.length === 0) {
        events.emit('verbose', 'No scripts found for hook "' + context.hook + '".');
    }
    return scripts.reduce(function (prevScriptPromise, nextScript) {
        return prevScriptPromise.then(function () {
            return runScript(nextScript, context);
        });
    }, Promise.resolve());
}
Serially fires scripts either via Promise.resolve(require(pathToScript)(context)) or via child_process.spawn.
Returns promise.