Compare commits

...

4 commits

Author SHA1 Message Date
3cd8b940da chore: add LICENSE 2022-09-05 23:56:24 -05:00
69260a7a7f style: change example colors 2022-09-05 23:48:32 -05:00
2070819393 chore: reduce whitespace 2022-09-05 23:45:07 -05:00
daylin
4e2a771b8c docs: typos 2022-09-05 23:31:26 -05:00
7 changed files with 64 additions and 67 deletions

9
LICENSE Normal file
View file

@ -0,0 +1,9 @@
Copyright 2022 Daylin Morgan
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -77,13 +77,15 @@ as python {a.bold}f-string{a.end} literals
{a.end} {a.end}
endef endef
## info | demonsrtate usage of tprint ## info | demonstrate usage of tprint
.PHONY: task .PHONY: task
info: info:
$(call header, Info Message) $(call header, Info Message)
$(call tprint,{a.b_magenta}This is task-print output:{a.end}) $(call tprint,{a.black_on_cyan}This is task-print output:{a.end})
$(call tprint,$(msg)) $(call tprint,$(msg))
task.mk:
./generate.py $(shell git describe --tags) > task.mk
define USAGE define USAGE
{a.$(HEADER_COLOR)}usage:{a.end} {a.$(HEADER_COLOR)}usage:{a.end}

View file

@ -119,8 +119,8 @@ You can take advantage of the builtin python script runner and write multi-line
This is a simple example but a few lines of python in your `Makefile` This is a simple example but a few lines of python in your `Makefile`
may be easier than balancing sub-shells and strung together awk commands. may be easier than balancing sub-shells and strung together awk commands.
When `make` expands the function it will take the parameters passed to `py` and expand them `$(1)` is the variable name. When `make` expands the function it will take the parameters passed to `py` and expand them.
`$(2)` in this case is the implicit pattern from the rule. Pay attention to quotes. `$(1)` is the variable name and `$(2)` in this case is the implicit pattern from the rule. Pay attention to quotes.
If you need to debug your python script, use `DEBUG=1` when you run `make` and it will first print the script that will be piped to `python`. If you need to debug your python script, use `DEBUG=1` when you run `make` and it will first print the script that will be piped to `python`.
```make ```make
@ -135,7 +135,7 @@ list-%:
$(call py,list_files_py,$*) $(call py,list_files_py,$*)
``` ```
For what it's worth there is also a predefined function for `bash` (named `tbash`) as well should you need to accomplish something similar of more easily embedding your bash script rather than having to escape every line with '\'. For what it's worth there is also a predefined function for `bash` (named `tbash`) as well should you need to accomplish something similar of more easily embedding your bash script rather than having to escape every line with a backslash.
```make ```make
define bash_script define bash_script
@ -182,10 +182,10 @@ But I just want a basic help output, surely I don't need python for this... you
```make ```make
## h, help | show this help ## h, help | show this help
.PHONY: help h .PHONY: help h
help h: Makefile params help h: Makefile
@awk -v fill=$(shell sed -n 's/^## \(.*\) | .*/\1/p' $< | wc -L)\ @awk -v fill=$(shell sed -n 's/^## \(.*\) | .*/\1/p' $< | wc -L)\
'match($$0,/^## (.*) \|/,name) && match($$0,/\| (.*)$$/,help)\ 'match($$0,/^## (.*) \|/,name) && match($$0,/\| (.*)$$/,help)\
{printf "\033[1;93m%*s\033[0m | \033[30m%s\033[0m\n",\ {printf "\033[1;93m%*s\033[0m | \033[30m%s\033[0m\n",\
fill,name[1],help[1];} match($$0,/^### (.*)/,str) \ fill,name[1],help[1];} match($$0,/^### (.*)/,str) \
{printf "%*s \033[30m%s\033[0m\n",fill," ",str[1];}' $< {printf "%*s \033[30m%s\033[0m\n",fill," ",str[1];}' $<
``` ```

View file

@ -16,14 +16,14 @@
font-weight: 700; font-weight: 700;
} }
.terminal-649569392-matrix { .terminal-649700464-matrix {
font-family: Fira Code, monospace; font-family: Fira Code, monospace;
font-size: 20px; font-size: 20px;
line-height: 24.4px; line-height: 24.4px;
font-variant-east-asian: full-width; font-variant-east-asian: full-width;
} }
.terminal-649569392-title { .terminal-649700464-title {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
font-family: arial; font-family: arial;
@ -33,95 +33,95 @@
-webkit-filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7)); -webkit-filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7)); filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
} }
.terminal-649569392-r1 { fill: #94e2d5;font-weight: bold } .terminal-649700464-r1 { fill: #94e2d5;font-weight: bold }
.terminal-649569392-r2 { fill: #c6d0f5 } .terminal-649700464-r2 { fill: #c6d0f5 }
.terminal-649569392-r3 { fill: #f5c2e7;font-weight: bold } .terminal-649700464-r3 { fill: #f5c2e7;font-weight: bold }
.terminal-649569392-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; } .terminal-649700464-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; }
.terminal-649569392-r5 { fill: #f9e2af;font-weight: bold } .terminal-649700464-r5 { fill: #f9e2af;font-weight: bold }
.terminal-649569392-r6 { fill: #8288a5 } .terminal-649700464-r6 { fill: #8288a5 }
</style> </style>
<defs> <defs>
<clipPath id="terminal-649569392-clip-terminal"> <clipPath id="terminal-649700464-clip-terminal">
<rect x="0" y="0" width="609.0" height="413.79999999999995" /> <rect x="0" y="0" width="609.0" height="413.79999999999995" />
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-0"> <clipPath id="terminal-649700464-line-0">
<rect x="0" y="1.5" width="610" height="24.65"/> <rect x="0" y="1.5" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-1"> <clipPath id="terminal-649700464-line-1">
<rect x="0" y="25.9" width="610" height="24.65"/> <rect x="0" y="25.9" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-2"> <clipPath id="terminal-649700464-line-2">
<rect x="0" y="50.3" width="610" height="24.65"/> <rect x="0" y="50.3" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-3"> <clipPath id="terminal-649700464-line-3">
<rect x="0" y="74.7" width="610" height="24.65"/> <rect x="0" y="74.7" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-4"> <clipPath id="terminal-649700464-line-4">
<rect x="0" y="99.1" width="610" height="24.65"/> <rect x="0" y="99.1" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-5"> <clipPath id="terminal-649700464-line-5">
<rect x="0" y="123.5" width="610" height="24.65"/> <rect x="0" y="123.5" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-6"> <clipPath id="terminal-649700464-line-6">
<rect x="0" y="147.9" width="610" height="24.65"/> <rect x="0" y="147.9" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-7"> <clipPath id="terminal-649700464-line-7">
<rect x="0" y="172.3" width="610" height="24.65"/> <rect x="0" y="172.3" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-8"> <clipPath id="terminal-649700464-line-8">
<rect x="0" y="196.7" width="610" height="24.65"/> <rect x="0" y="196.7" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-9"> <clipPath id="terminal-649700464-line-9">
<rect x="0" y="221.1" width="610" height="24.65"/> <rect x="0" y="221.1" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-10"> <clipPath id="terminal-649700464-line-10">
<rect x="0" y="245.5" width="610" height="24.65"/> <rect x="0" y="245.5" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-11"> <clipPath id="terminal-649700464-line-11">
<rect x="0" y="269.9" width="610" height="24.65"/> <rect x="0" y="269.9" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-12"> <clipPath id="terminal-649700464-line-12">
<rect x="0" y="294.3" width="610" height="24.65"/> <rect x="0" y="294.3" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-13"> <clipPath id="terminal-649700464-line-13">
<rect x="0" y="318.7" width="610" height="24.65"/> <rect x="0" y="318.7" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-14"> <clipPath id="terminal-649700464-line-14">
<rect x="0" y="343.1" width="610" height="24.65"/> <rect x="0" y="343.1" width="610" height="24.65"/>
</clipPath> </clipPath>
<clipPath id="terminal-649569392-line-15"> <clipPath id="terminal-649700464-line-15">
<rect x="0" y="367.5" width="610" height="24.65"/> <rect x="0" y="367.5" width="610" height="24.65"/>
</clipPath> </clipPath>
</defs> </defs>
<rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="626" height="462.8" rx="8"/><text class="terminal-649569392-title" fill="#c6d0f5" text-anchor="middle" x="313" y="27">make&#160;help</text> <rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="626" height="462.8" rx="8"/><text class="terminal-649700464-title" fill="#c6d0f5" text-anchor="middle" x="313" y="27">make&#160;help</text>
<g transform="translate(32,22)"> <g transform="translate(32,22)">
<circle cx="0" cy="0" r="7" fill="#ff5f57"/> <circle cx="0" cy="0" r="7" fill="#ff5f57"/>
<circle cx="22" cy="0" r="7" fill="#febc2e"/> <circle cx="22" cy="0" r="7" fill="#febc2e"/>
<circle cx="44" cy="0" r="7" fill="#28c840"/> <circle cx="44" cy="0" r="7" fill="#28c840"/>
</g> </g>
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-649569392-clip-terminal)"> <g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-649700464-clip-terminal)">
<g class="terminal-649569392-matrix"> <g class="terminal-649700464-matrix">
<text class="terminal-649569392-r1" x="0" y="20" textLength="73.2" clip-path="url(#terminal-649569392-line-0)">usage:</text><text class="terminal-649569392-r2" x="610" y="20" textLength="12.2" clip-path="url(#terminal-649569392-line-0)"> <text class="terminal-649700464-r1" x="0" y="20" textLength="73.2" clip-path="url(#terminal-649700464-line-0)">usage:</text><text class="terminal-649700464-r2" x="610" y="20" textLength="12.2" clip-path="url(#terminal-649700464-line-0)">
</text><text class="terminal-649569392-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-649569392-line-1)">make&#160;&lt;recipe&gt;</text><text class="terminal-649569392-r2" x="610" y="44.4" textLength="12.2" clip-path="url(#terminal-649569392-line-1)"> </text><text class="terminal-649700464-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-649700464-line-1)">make&#160;&lt;recipe&gt;</text><text class="terminal-649700464-r2" x="610" y="44.4" textLength="12.2" clip-path="url(#terminal-649700464-line-1)">
</text><text class="terminal-649569392-r2" x="610" y="68.8" textLength="12.2" clip-path="url(#terminal-649569392-line-2)"> </text><text class="terminal-649700464-r2" x="610" y="68.8" textLength="12.2" clip-path="url(#terminal-649700464-line-2)">
</text><text class="terminal-649569392-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-649569392-line-3)">&#160;&#160;Turn&#160;your&#160;</text><text class="terminal-649569392-r3" x="146.4" y="93.2" textLength="122" clip-path="url(#terminal-649569392-line-3)">`Makefile`</text><text class="terminal-649569392-r2" x="268.4" y="93.2" textLength="61" clip-path="url(#terminal-649569392-line-3)">&#160;into</text><text class="terminal-649569392-r2" x="610" y="93.2" textLength="12.2" clip-path="url(#terminal-649569392-line-3)"> </text><text class="terminal-649700464-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-649700464-line-3)">&#160;&#160;Turn&#160;your&#160;</text><text class="terminal-649700464-r3" x="146.4" y="93.2" textLength="122" clip-path="url(#terminal-649700464-line-3)">`Makefile`</text><text class="terminal-649700464-r2" x="268.4" y="93.2" textLength="61" clip-path="url(#terminal-649700464-line-3)">&#160;into</text><text class="terminal-649700464-r2" x="610" y="93.2" textLength="12.2" clip-path="url(#terminal-649700464-line-3)">
</text><text class="terminal-649569392-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-649569392-line-4)">&#160;&#160;the&#160;</text><text class="terminal-649569392-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-649569392-line-4)">task&#160;runner</text><text class="terminal-649569392-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-649569392-line-4)">&#160;you&#160;always&#160;needed.</text><text class="terminal-649569392-r2" x="610" y="117.6" textLength="12.2" clip-path="url(#terminal-649569392-line-4)"> </text><text class="terminal-649700464-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-649700464-line-4)">&#160;&#160;the&#160;</text><text class="terminal-649700464-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-649700464-line-4)">task&#160;runner</text><text class="terminal-649700464-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-649700464-line-4)">&#160;you&#160;always&#160;needed.</text><text class="terminal-649700464-r2" x="610" y="117.6" textLength="12.2" clip-path="url(#terminal-649700464-line-4)">
</text><text class="terminal-649569392-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-649569392-line-5)">&#160;&#160;See&#160;the&#160;example&#160;output&#160;below.</text><text class="terminal-649569392-r2" x="610" y="142" textLength="12.2" clip-path="url(#terminal-649569392-line-5)"> </text><text class="terminal-649700464-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-649700464-line-5)">&#160;&#160;See&#160;the&#160;example&#160;output&#160;below.</text><text class="terminal-649700464-r2" x="610" y="142" textLength="12.2" clip-path="url(#terminal-649700464-line-5)">
</text><text class="terminal-649569392-r2" x="610" y="166.4" textLength="12.2" clip-path="url(#terminal-649569392-line-6)"> </text><text class="terminal-649700464-r2" x="610" y="166.4" textLength="12.2" clip-path="url(#terminal-649700464-line-6)">
</text><text class="terminal-649569392-r5" x="0" y="190.8" textLength="109.8" clip-path="url(#terminal-649569392-line-7)">bootstrap</text><text class="terminal-649569392-r2" x="109.8" y="190.8" textLength="36.6" clip-path="url(#terminal-649569392-line-7)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="190.8" textLength="366" clip-path="url(#terminal-649569392-line-7)">generate&#160;local&#160;dev&#160;environment</text><text class="terminal-649569392-r2" x="610" y="190.8" textLength="12.2" clip-path="url(#terminal-649569392-line-7)"> </text><text class="terminal-649700464-r5" x="0" y="190.8" textLength="109.8" clip-path="url(#terminal-649700464-line-7)">bootstrap</text><text class="terminal-649700464-r2" x="109.8" y="190.8" textLength="36.6" clip-path="url(#terminal-649700464-line-7)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="190.8" textLength="366" clip-path="url(#terminal-649700464-line-7)">generate&#160;local&#160;dev&#160;environment</text><text class="terminal-649700464-r2" x="610" y="190.8" textLength="12.2" clip-path="url(#terminal-649700464-line-7)">
</text><text class="terminal-649569392-r5" x="0" y="215.2" textLength="109.8" clip-path="url(#terminal-649569392-line-8)">&#160;&#160;&#160;&#160;&#160;lint</text><text class="terminal-649569392-r2" x="109.8" y="215.2" textLength="36.6" clip-path="url(#terminal-649569392-line-8)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="215.2" textLength="183" clip-path="url(#terminal-649569392-line-8)">lint&#160;the&#160;python</text><text class="terminal-649569392-r2" x="610" y="215.2" textLength="12.2" clip-path="url(#terminal-649569392-line-8)"> </text><text class="terminal-649700464-r5" x="0" y="215.2" textLength="109.8" clip-path="url(#terminal-649700464-line-8)">&#160;&#160;&#160;&#160;&#160;lint</text><text class="terminal-649700464-r2" x="109.8" y="215.2" textLength="36.6" clip-path="url(#terminal-649700464-line-8)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="215.2" textLength="183" clip-path="url(#terminal-649700464-line-8)">lint&#160;the&#160;python</text><text class="terminal-649700464-r2" x="610" y="215.2" textLength="12.2" clip-path="url(#terminal-649700464-line-8)">
</text><text class="terminal-649569392-r5" x="0" y="239.6" textLength="109.8" clip-path="url(#terminal-649569392-line-9)">&#160;&#160;&#160;assets</text><text class="terminal-649569392-r2" x="109.8" y="239.6" textLength="36.6" clip-path="url(#terminal-649569392-line-9)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="239.6" textLength="183" clip-path="url(#terminal-649569392-line-9)">generate&#160;assets</text><text class="terminal-649569392-r2" x="610" y="239.6" textLength="12.2" clip-path="url(#terminal-649569392-line-9)"> </text><text class="terminal-649700464-r5" x="0" y="239.6" textLength="109.8" clip-path="url(#terminal-649700464-line-9)">&#160;&#160;&#160;assets</text><text class="terminal-649700464-r2" x="109.8" y="239.6" textLength="36.6" clip-path="url(#terminal-649700464-line-9)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="239.6" textLength="183" clip-path="url(#terminal-649700464-line-9)">generate&#160;assets</text><text class="terminal-649700464-r2" x="610" y="239.6" textLength="12.2" clip-path="url(#terminal-649700464-line-9)">
</text><text class="terminal-649569392-r5" x="0" y="264" textLength="109.8" clip-path="url(#terminal-649569392-line-10)">&#160;&#160;&#160;list-%</text><text class="terminal-649569392-r2" x="109.8" y="264" textLength="36.6" clip-path="url(#terminal-649569392-line-10)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="264" textLength="366" clip-path="url(#terminal-649569392-line-10)">use&#160;pathlib.Path&#160;to&#160;list&#160;files</text><text class="terminal-649569392-r2" x="610" y="264" textLength="12.2" clip-path="url(#terminal-649569392-line-10)"> </text><text class="terminal-649700464-r5" x="0" y="264" textLength="109.8" clip-path="url(#terminal-649700464-line-10)">&#160;&#160;&#160;list-%</text><text class="terminal-649700464-r2" x="109.8" y="264" textLength="36.6" clip-path="url(#terminal-649700464-line-10)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="264" textLength="366" clip-path="url(#terminal-649700464-line-10)">use&#160;pathlib.Path&#160;to&#160;list&#160;files</text><text class="terminal-649700464-r2" x="610" y="264" textLength="12.2" clip-path="url(#terminal-649700464-line-10)">
</text><text class="terminal-649569392-r5" x="0" y="288.4" textLength="109.8" clip-path="url(#terminal-649569392-line-11)">&#160;&#160;release</text><text class="terminal-649569392-r2" x="109.8" y="288.4" textLength="36.6" clip-path="url(#terminal-649569392-line-11)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="288.4" textLength="366" clip-path="url(#terminal-649569392-line-11)">release&#160;new&#160;version&#160;of&#160;task.mk</text><text class="terminal-649569392-r2" x="610" y="288.4" textLength="12.2" clip-path="url(#terminal-649569392-line-11)"> </text><text class="terminal-649700464-r5" x="0" y="288.4" textLength="109.8" clip-path="url(#terminal-649700464-line-11)">&#160;&#160;release</text><text class="terminal-649700464-r2" x="109.8" y="288.4" textLength="36.6" clip-path="url(#terminal-649700464-line-11)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="288.4" textLength="366" clip-path="url(#terminal-649700464-line-11)">release&#160;new&#160;version&#160;of&#160;task.mk</text><text class="terminal-649700464-r2" x="610" y="288.4" textLength="12.2" clip-path="url(#terminal-649700464-line-11)">
</text><text class="terminal-649569392-r5" x="0" y="312.8" textLength="109.8" clip-path="url(#terminal-649569392-line-12)">&#160;c,&#160;clean</text><text class="terminal-649569392-r2" x="109.8" y="312.8" textLength="36.6" clip-path="url(#terminal-649569392-line-12)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="312.8" textLength="317.2" clip-path="url(#terminal-649569392-line-12)">remove&#160;the&#160;generated&#160;files</text><text class="terminal-649569392-r2" x="610" y="312.8" textLength="12.2" clip-path="url(#terminal-649569392-line-12)"> </text><text class="terminal-649700464-r5" x="0" y="312.8" textLength="109.8" clip-path="url(#terminal-649700464-line-12)">&#160;c,&#160;clean</text><text class="terminal-649700464-r2" x="109.8" y="312.8" textLength="36.6" clip-path="url(#terminal-649700464-line-12)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="312.8" textLength="317.2" clip-path="url(#terminal-649700464-line-12)">remove&#160;the&#160;generated&#160;files</text><text class="terminal-649700464-r2" x="610" y="312.8" textLength="12.2" clip-path="url(#terminal-649700464-line-12)">
</text><text class="terminal-649569392-r5" x="0" y="337.2" textLength="109.8" clip-path="url(#terminal-649569392-line-13)">&#160;&#160;&#160;&#160;&#160;info</text><text class="terminal-649569392-r2" x="109.8" y="337.2" textLength="36.6" clip-path="url(#terminal-649569392-line-13)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="337.2" textLength="329.4" clip-path="url(#terminal-649569392-line-13)">demonsrtate&#160;usage&#160;of&#160;tprint</text><text class="terminal-649569392-r2" x="610" y="337.2" textLength="12.2" clip-path="url(#terminal-649569392-line-13)"> </text><text class="terminal-649700464-r5" x="0" y="337.2" textLength="109.8" clip-path="url(#terminal-649700464-line-13)">&#160;&#160;&#160;&#160;&#160;info</text><text class="terminal-649700464-r2" x="109.8" y="337.2" textLength="36.6" clip-path="url(#terminal-649700464-line-13)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="337.2" textLength="329.4" clip-path="url(#terminal-649700464-line-13)">demonstrate&#160;usage&#160;of&#160;tprint</text><text class="terminal-649700464-r2" x="610" y="337.2" textLength="12.2" clip-path="url(#terminal-649700464-line-13)">
</text><text class="terminal-649569392-r5" x="0" y="361.6" textLength="109.8" clip-path="url(#terminal-649569392-line-14)">&#160;&#160;h,&#160;help</text><text class="terminal-649569392-r2" x="109.8" y="361.6" textLength="36.6" clip-path="url(#terminal-649569392-line-14)">&#160;|&#160;</text><text class="terminal-649569392-r6" x="146.4" y="361.6" textLength="170.8" clip-path="url(#terminal-649569392-line-14)">show&#160;this&#160;help</text><text class="terminal-649569392-r2" x="610" y="361.6" textLength="12.2" clip-path="url(#terminal-649569392-line-14)"> </text><text class="terminal-649700464-r5" x="0" y="361.6" textLength="109.8" clip-path="url(#terminal-649700464-line-14)">&#160;&#160;h,&#160;help</text><text class="terminal-649700464-r2" x="109.8" y="361.6" textLength="36.6" clip-path="url(#terminal-649700464-line-14)">&#160;|&#160;</text><text class="terminal-649700464-r6" x="146.4" y="361.6" textLength="170.8" clip-path="url(#terminal-649700464-line-14)">show&#160;this&#160;help</text><text class="terminal-649700464-r2" x="610" y="361.6" textLength="12.2" clip-path="url(#terminal-649700464-line-14)">
</text><text class="terminal-649569392-r2" x="610" y="386" textLength="12.2" clip-path="url(#terminal-649569392-line-15)"> </text><text class="terminal-649700464-r2" x="610" y="386" textLength="12.2" clip-path="url(#terminal-649700464-line-15)">
</text><text class="terminal-649569392-r2" x="0" y="410.4" textLength="610" clip-path="url(#terminal-649569392-line-16)">for&#160;more&#160;info:&#160;see&#160;github.com/daylinmorgan/task.mk</text><text class="terminal-649569392-r2" x="610" y="410.4" textLength="12.2" clip-path="url(#terminal-649569392-line-16)"> </text><text class="terminal-649700464-r2" x="0" y="410.4" textLength="610" clip-path="url(#terminal-649700464-line-16)">for&#160;more&#160;info:&#160;see&#160;github.com/daylinmorgan/task.mk</text><text class="terminal-649700464-r2" x="610" y="410.4" textLength="12.2" clip-path="url(#terminal-649700464-line-16)">
</text> </text>
</g> </g>
</g> </g>

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -1,5 +1,3 @@
define #% block name %##% endblock %#_py define #% block name %##% endblock %#_py
#% block script %##% endblock %# #% block script %##% endblock %#
endef endef

View file

@ -1,7 +1,6 @@
#% extends "py-script.mk" %# #% extends "py-script.mk" %#
#% block name %#vars#% endblock %# #% block name %#vars#% endblock %#
#% block script %# #% block script %#
import os import os
##- '$(ansi_py)' -## ##- '$(ansi_py)' -##

13
task.mk
View file

@ -1,7 +1,7 @@
# }> [github.com/daylinmorgan/task.mk] <{ # # }> [github.com/daylinmorgan/task.mk] <{ #
# Copyright (c) 2022 Daylin Morgan # Copyright (c) 2022 Daylin Morgan
# MIT License # MIT License
# 22.9.5 # v22.9.5-3-g9c67418
# #
# task.mk should be included at the bottom of your Makefile. # task.mk should be included at the bottom of your Makefile.
# See below for the standard configuration options that should be set prior to including this file. # See below for the standard configuration options that should be set prior to including this file.
@ -103,7 +103,6 @@ pysh = printf "$(call create_string,$($(1)))" | python3
define help_py define help_py
import os import os
import re import re
@ -141,12 +140,10 @@ for goal, msg in goals:
print(f"""$(EPILOG)""") print(f"""$(EPILOG)""")
endef endef
define ansi_py define ansi_py
import os import os
import sys import sys
@ -197,22 +194,18 @@ class Ansi:
a = ansi = Ansi() a = ansi = Ansi()
endef endef
define info_py define info_py
$(ansi_py) $(ansi_py)
print(f"""$(2)""") print(f"""$(2)""")
endef endef
define print_ansi_py define print_ansi_py
$(ansi_py) $(ansi_py)
codes_names = { codes_names = {
@ -224,13 +217,10 @@ for code in sorted(codes_names.keys(), key=lambda item: (len(item), item)):
print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end)) print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end))
endef endef
define vars_py define vars_py
import os import os
$(ansi_py) $(ansi_py)
@ -245,6 +235,5 @@ for v in vars:
print() print()
endef endef