2019-11-16 22:40:36 +00:00
|
|
|
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;
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
}
|