tapbundle/ts/tapbundle.classes.pretask.ts

22 lines
585 B
TypeScript
Raw Normal View History

import * as plugins from './tapbundle.plugins';
import { TapTools } from './tapbundle.classes.taptools';
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
}