tapbundle/ts/tapbundle.classes.pretask.ts

22 lines
591 B
TypeScript
Raw Permalink Normal View History

2022-03-14 10:22:17 +00:00
import * as plugins from './tapbundle.plugins.js';
import { TapTools } from './tapbundle.classes.taptools.js';
export interface IPreTaskFunction {
(tapTools?: TapTools): Promise<any>;
}
export class PreTask {
2020-03-15 16:36:25 +00:00
public description: string;
public preTaskFunction: IPreTaskFunction;
2020-03-15 16:36:25 +00:00
constructor(descriptionArg: string, preTaskFunctionArg: IPreTaskFunction) {
this.description = descriptionArg;
this.preTaskFunction = preTaskFunctionArg;
}
2020-07-08 00:17:25 +00:00
public async run() {
2020-03-15 16:36:25 +00:00
console.log(`::__PRETASK: ${this.description}`);
await this.preTaskFunction(new TapTools(null));
}
2020-07-08 00:17:25 +00:00
}