-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yml
More file actions
37 lines (31 loc) · 1.2 KB
/
Taskfile.yml
File metadata and controls
37 lines (31 loc) · 1.2 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
version: "3"
env:
TOOL: "octoprint-plugin-tool"
tasks:
update-readme:
cmds:
- |
help_command="$TOOL"
help_output=$($help_command)
pyproject_command="$TOOL to-pyproject --help"
pyproject_output=$($pyproject_command)
#example_command="octoplugin to-pyproject tests/legacy-plugin"
#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="$pyproject_command" -v output="$pyproject_output" '
BEGIN{p=1}
$1=="<!--INSERT:to-pyproject-->"{p=0;print;next}
$1=="<!--/INSERT:to-pyproject-->"{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