forked from zifeo/whiz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
whiz.yaml
129 lines (105 loc) · 3.05 KB
/
whiz.yaml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
env:
B: second
speedy:
command: 'for i in {10..50}; do for j in {10..30}; do echo -n "$i-$j "; done; echo; done'
watch:
- "src/**/*.rs"
err:
command: exit 1
once:
workdir: .
watch: "*"
env:
A: world
command: "echo hello $A"
entrypoint_only:
entrypoint: "ls ./src ./src/config"
command: ''
once_b:
command: "sleep 2 && echo $B"
depends_on: once
once_c:
command: "echo C"
depends_on:
- once
- once_b
sleep_count:
workdir: .
watch: .
command: "for ((i=0; i<10; i=i+1)); do echo $TEST $i; sleep 1; done"
env:
TEST: "hello from $HOME "
depends_on:
- once
no_command:
entrypoint: python3 -c "print(\"No command specified\")"
no_explicit_entrypoint:
command: echo "there's no entrypoint :("
dodo:
workdir: .
watch: target
command: "sleep 30"
depends_on:
- once
color:
command: python3 -c 'print(u"\u001b[31mHelloWorld\u001b[0m")'
color2:
command: 'print(u"\033[92mHello World\033[0m")'
entrypoint: 'python3 -c'
what_shell:
command: echo $(which $0)
entrypoint: 'sh -c'
watch_parent:
workdir: src
command: ls
watch:
- "*"
- "../*"
env_test:
workdir: src
command: "echo $hello $world $version !"
env:
hello: "bonjour"
version: file://../Cargo.toml?query=.package.version
env_file:
- ../.env.example
pipe_test:
# each log file created from output redirection will
# be ignored from the watcher to avoid infinite loops
# when writting to them
watch: "*"
command: |
echo "[app] GET / 200 - Ok"
echo "[app] GET / 204 - No Content"
echo "[ERROR] POST /home 400 - Not Found"
echo "[TRACE] Authentication failed for API key '1234'"
echo "[PRIVATE] message"
echo "[server] GET /movies - requester: http://cinema.com"
echo "animal:cat says meow"
echo "Au revoir!"
pipe:
# Create a new tab for messages containing the text '[app]'
'^\[app\]': whiz://virtual_views
# Create a new tab for messages containing the text 'ERROR'
# or `error`
"^.*(ERROR|error).*$": whiz://virtual_views_error
# Silence messages containing "TRACE" word
"^.*TRACE.*$": /dev/null
# Silence messages containing "SERCRET" word
# with implicit scheme `file`
"^.*PRIVATE.*$": file:///dev/null
# Save matched content as a log file
# using capture groups
'.*https?://([a-zA-Z0-9_\-\.]+).*$': ./logs/$1/requests.log
# Save matched content as a log file
# using named capture groups
"animal:(?P<name>[a-zA-Z0-9_]+).*$": ./logs/animals/${name}.log
# Content not matched by a regular expression goes to
# `whiz://{task_name}` by default
friends_conversation:
command: |
echo "[message] Dave: hello"
echo "[message] Bob: bonjour"
pipe:
# Dynamic naming for virtual tabs generation
'^\[message\] (?P<name>[a-zA-Z]+):.*$': whiz://talker_${name}