blob: 02ce31e2d18d552dcc0e07054d9ec9946383b7d3 [file] [log] [blame]
import Features from '../../../features/Features';
import StandaloneScripts from '../../../scripts/Scripts';
import ScriptProvider from '../scripts/ScriptProvider';
import ScriptRunner from '../scripts/ScriptRunner';
import { Context } from './Context';
export default class EntrypointScriptRunner {
private scriptRunner: ScriptRunner;
constructor(public context: Context) {
this.scriptRunner = new ScriptRunner();
this.addScriptProvider(new Features());
this.addScriptProvider(new StandaloneScripts());
}
addScriptProvider(scriptProvider: ScriptProvider): EntrypointScriptRunner {
const scripts = scriptProvider.getScripts(this.context);
this.scriptRunner.add(...scripts);
return this;
}
run() {
this.scriptRunner.run();
}
}