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