import * as color from "colorette" ; import { EventEmitter } from "events" ; import * as tr from "text-runner-core" ; import * as configFile from "../config-file" ; import * as config from "../configuration" ; export class SetupCommand implements tr . commands . Command { config : config . Data ; emitter : EventEmitter ; constructor ( config ) { this . config = config ; this . emitter = new EventEmitter ( ) ; } emit ( name , payload ) { this . emitter . emit ( name , payload ) ; } async execute ( ) { await configFile . create ( this . config ) ; this . emit ( "output" , `Created configuration file ${ color . cyan ( "text-run.yml" ) } with default values` ) ; } on ( name , handler ) { this . emitter . on ( name , handler ) ; return this ; } }