-
Notifications
You must be signed in to change notification settings - Fork 1
/
ghjk.ts
43 lines (36 loc) · 884 Bytes
/
ghjk.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
31
32
33
34
35
36
37
38
39
40
41
42
43
export { sophon } from "../../hack.ts";
import { logger, task } from "../../hack.ts";
import * as ports from "../../ports/mod.ts";
task("greet", async ($, { argv: [name] }) => {
await $`echo Hello ${name}!`;
});
const ha = task({
name: "ha",
installs: [ports.jq_ghrel()],
vars: { STUFF: "stuffier" },
async fn($) {
await $`echo $STUFF;
jq --version;
`;
},
});
task("ho", {
dependsOn: [ha],
fn: () => logger().info(`ho`),
});
task("hii", {
// task `dependsOn` declaration is order-independent
dependsOn: ["hum"],
fn: () => logger().info(`haii`),
});
task("hum", {
dependsOn: ["ho"],
fn: () => logger().info(`hum`),
});
// not all tasks need to be named
// but anon tasks can't be accessed from the CLI
const anon = task(() => logger().info("anon"));
task("hey", {
dependsOn: ["hii", "ho", anon],
fn: () => logger().info(`hey`),
});