forked from hofstadter-io/hof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflow.cue
45 lines (40 loc) · 764 Bytes
/
flow.cue
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
44
45
package hof
import "strings"
RepoRoot: {
@task(os.Exec)
cmd: ["bash", "-c", "git rev-parse --show-toplevel"]
stdout: string
out: strings.TrimSpace(stdout)
}
watchBuild: {
@flow(watch/build)
// have to localize this task in a flow for it to work
RR: RepoRoot
root: RR.out
dirs: ["cmd", "flow", "lib", "gen"]
watch: {
@task(os.Watch)
globs: [ for d in dirs {"\(root)/\(d)/**/*.go"}]
handler: {
event?: _
compile: {
@task(os.Exec)
cmd: ["go", "install", "\(root)/cmd/hof"]
env: {
CGO_ENABLE: "0"
}
exitcode: _
}
now: {
dep: compile.exitcode
n: string @task(gen.Now)
s: "\(n) (\(dep))"
}
alert: {
@task(os.Stdout)
dep: now.s
text: "hof rebuilt \(now.s)\n"
}
}
}
}