@@ -5,16 +5,16 @@ import { tail } from "../../common/tail";
|
||||
import { type Config, Platform } from "../../core/type";
|
||||
import { Target } from "./target";
|
||||
|
||||
export type RunnerFactory = new (config: Config, debug: boolean) => Runner;
|
||||
export type RunnerFactory = new (config: Config, debug?: boolean) => Runner;
|
||||
|
||||
export class Runner extends Target {
|
||||
static factory: Record<string, RunnerFactory> = {};
|
||||
|
||||
public debug: boolean;
|
||||
|
||||
constructor(config: Config, platform: Platform, debug: boolean) {
|
||||
constructor(config: Config, platform: Platform, debug?: boolean) {
|
||||
super(config, platform);
|
||||
this.debug = debug;
|
||||
this.debug = debug || false;
|
||||
}
|
||||
|
||||
log(stream: any) {
|
||||
@@ -25,7 +25,7 @@ export class Runner extends Target {
|
||||
Runner.factory[platform] = runner;
|
||||
}
|
||||
|
||||
static new(config: Config, platform: string, debug: boolean): Runner {
|
||||
static new(config: Config, platform: string, debug?: boolean): Runner {
|
||||
return new Runner.factory[platform](config, debug);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ export class Target {
|
||||
this.target = "target";
|
||||
}
|
||||
|
||||
prepare(): Promise<any> {
|
||||
setup(): Promise<any> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user