-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yml
More file actions
43 lines (37 loc) · 1.55 KB
/
Taskfile.yml
File metadata and controls
43 lines (37 loc) · 1.55 KB
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
version: "3"
tasks:
update-readme:
cmds:
- |
help_command="gcode-thumbnail-tool"
help_output=$($help_command)
extract_command="gcode-thumbnail-tool extract --help"
extract_output=$($extract_command)
analyse_command="gcode-thumbnail-tool analyse --help"
analyse_output=$($analyse_command)
example_command="gcode-thumbnail-tool analyse tests/_files/prusa_2.9.3.gcode"
example_output=$($example_command)
awk -i inplace -v command="$help_command" -v output="$help_output" '
BEGIN{p=1}
$1=="<!--INSERT:help-->"{p=0;print;next}
$1=="<!--/INSERT:help-->"{print "```\n$ " command "\n" output "\n```"; p=1}
p
' README.md
awk -i inplace -v command="$extract_command" -v output="$extract_output" '
BEGIN{p=1}
$1=="<!--INSERT:extract-->"{p=0;print;next}
$1=="<!--/INSERT:extract-->"{print "```\n$ " command "\n" output "\n```"; p=1}
p
' README.md
awk -i inplace -v command="$analyse_command" -v output="$analyse_output" '
BEGIN{p=1}
$1=="<!--INSERT:analyse-->"{p=0;print;next}
$1=="<!--/INSERT:analyse-->"{print "```\n$ " command "\n" output "\n```"; p=1}
p
' README.md
awk -i inplace -v command="$example_command" -v output="$example_output" '
BEGIN{p=1}
$1=="<!--INSERT:example-->"{p=0;print;next}
$1=="<!--/INSERT:example-->"{print "```\n$ " command "\n" output "\n```"; p=1}
p
' README.md