-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.ts
30 lines (27 loc) · 991 Bytes
/
Taskfile.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import * as t from "./task/core.ts";
import * as udd from "./task/udd.ts";
import * as ss from "./sql/shell/task.ts";
// see setup and usage instructions in lib/task/README.md
export class Tasks extends t.EventEmitter<{
help(): void;
updateSupportDeps(): Promise<void>;
updateDenoDeps(): Promise<void>;
maintain(): Promise<void>;
}> {
constructor() {
super();
// this is ugly but necessary due to events.EventEmitter making _events_ private :-(
this.on("help", t.eeHelpTask(this));
this.on("updateSupportDeps", ss.ensureSupportBinsTask());
this.on("updateDenoDeps", udd.updateDenoDepsTask());
this.on("maintain", async () => {
await this.emit("updateSupportDeps");
await this.emit("updateDenoDeps");
});
}
}
// only execute tasks if Taskfile.ts is being called as a script; otherwise
// it might be imported for tasks or other reasons and we shouldn't "run".
if (import.meta.main) {
await t.eventEmitterCLI(Deno.args, new Tasks());
}