mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-22 01:50:44 -06:00
Compare commits
5 commits
c036a27a57
...
a93e81d4bb
Author | SHA1 | Date | |
---|---|---|---|
a93e81d4bb | |||
d395d7e2a3 | |||
c1771c1d0f | |||
ec1430bc04 | |||
41c398065c |
6 changed files with 95 additions and 106 deletions
5
.githooks/pre-commit
Executable file
5
.githooks/pre-commit
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eo pipefail
|
||||
|
||||
make task.mk
|
||||
git add task.mk
|
12
Makefile
12
Makefile
|
@ -10,6 +10,7 @@ bootstrap:
|
|||
$(call msg,Bootstrap Environment)
|
||||
@mamba create -p ./env python jinja2 black -y
|
||||
@mamba run -p ./env pip install yartsu
|
||||
@git config core.hooksPath .githooks
|
||||
|
||||
## lint | lint the python
|
||||
.PHONY: lint
|
||||
|
@ -36,10 +37,11 @@ list-%:
|
|||
.PHONY: release
|
||||
release: version-check
|
||||
$(call msg,Release Project)
|
||||
@./generate.py $(VERSION) > task.mk
|
||||
# @./generate.py $(VERSION) > task.mk
|
||||
@./make task.mk
|
||||
@sed -i 's/task.mk\/.*\/task.mk/task.mk\/v$(VERSION)\/task.mk/g' README.md
|
||||
@git add task.mk README.md
|
||||
@git commit -m "release: v$(VERSION)"
|
||||
@git commit -m "release: v$(VERSION)" --no-verify
|
||||
@git tag v$(VERSION)
|
||||
|
||||
## c, clean | remove the generated files
|
||||
|
@ -86,8 +88,8 @@ info:
|
|||
$(call tprint,$(mlmsg))
|
||||
$(call tprint,{a.custom(fg=(148, 255, 15),bg=(103, 2, 15))}Custom Colors TOO!{a.end})
|
||||
|
||||
task.mk:
|
||||
./generate.py $(shell git describe --tags) > task.mk
|
||||
task.mk: $(TEMPLATES) generate.py
|
||||
./generate.py $(VERSION) > task.mk
|
||||
|
||||
define USAGE
|
||||
{a.$(HEADER_COLOR)}usage:{a.end}
|
||||
|
@ -99,7 +101,7 @@ define USAGE
|
|||
|
||||
endef
|
||||
|
||||
EPILOG = \nfor more info: see github.com/daylinmorgan/task.mk
|
||||
EPILOG = \nfor more info: github.com/daylinmorgan/task.mk
|
||||
PRINT_VARS := VERSION
|
||||
|
||||
-include .task.mk
|
||||
|
|
126
assets/help.svg
126
assets/help.svg
|
@ -1,4 +1,4 @@
|
|||
<svg class="rich-terminal shadow" viewBox="0 0 646.3333333333334 497.13333333333327" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg class="rich-terminal shadow" viewBox="0 0 598.3333333333334 497.13333333333327" xmlns="http://www.w3.org/2000/svg">
|
||||
<!-- Generated with Rich https://www.textualize.io -->
|
||||
<style>
|
||||
@font-face {
|
||||
|
@ -16,14 +16,14 @@
|
|||
font-weight: 700;
|
||||
}
|
||||
|
||||
.terminal-649700464-matrix {
|
||||
.terminal-2624234259-matrix {
|
||||
font-family: Fira Code, monospace;
|
||||
font-size: 20px;
|
||||
line-height: 24.4px;
|
||||
font-variant-east-asian: full-width;
|
||||
}
|
||||
|
||||
.terminal-649700464-title {
|
||||
.terminal-2624234259-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
font-family: arial;
|
||||
|
@ -33,95 +33,95 @@
|
|||
-webkit-filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
|
||||
filter: drop-shadow( 2px 5px 2px rgba(0, 0, 0, .7));
|
||||
}
|
||||
.terminal-649700464-r1 { fill: #94e2d5;font-weight: bold }
|
||||
.terminal-649700464-r2 { fill: #c6d0f5 }
|
||||
.terminal-649700464-r3 { fill: #f5c2e7;font-weight: bold }
|
||||
.terminal-649700464-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; }
|
||||
.terminal-649700464-r5 { fill: #f9e2af;font-weight: bold }
|
||||
.terminal-649700464-r6 { fill: #8288a5 }
|
||||
.terminal-2624234259-r1 { fill: #94e2d5;font-weight: bold }
|
||||
.terminal-2624234259-r2 { fill: #c6d0f5 }
|
||||
.terminal-2624234259-r3 { fill: #f5c2e7;font-weight: bold }
|
||||
.terminal-2624234259-r4 { fill: #c6d0f5;font-style: italic;;text-decoration: underline; }
|
||||
.terminal-2624234259-r5 { fill: #f9e2af;font-weight: bold }
|
||||
.terminal-2624234259-r6 { fill: #8288a5 }
|
||||
</style>
|
||||
|
||||
<defs>
|
||||
<clipPath id="terminal-649700464-clip-terminal">
|
||||
<rect x="0" y="0" width="609.0" height="413.79999999999995" />
|
||||
<clipPath id="terminal-2624234259-clip-terminal">
|
||||
<rect x="0" y="0" width="560.1999999999999" height="413.79999999999995" />
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-0">
|
||||
<rect x="0" y="1.5" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-0">
|
||||
<rect x="0" y="1.5" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-1">
|
||||
<rect x="0" y="25.9" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-1">
|
||||
<rect x="0" y="25.9" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-2">
|
||||
<rect x="0" y="50.3" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-2">
|
||||
<rect x="0" y="50.3" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-3">
|
||||
<rect x="0" y="74.7" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-3">
|
||||
<rect x="0" y="74.7" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-4">
|
||||
<rect x="0" y="99.1" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-4">
|
||||
<rect x="0" y="99.1" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-5">
|
||||
<rect x="0" y="123.5" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-5">
|
||||
<rect x="0" y="123.5" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-6">
|
||||
<rect x="0" y="147.9" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-6">
|
||||
<rect x="0" y="147.9" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-7">
|
||||
<rect x="0" y="172.3" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-7">
|
||||
<rect x="0" y="172.3" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-8">
|
||||
<rect x="0" y="196.7" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-8">
|
||||
<rect x="0" y="196.7" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-9">
|
||||
<rect x="0" y="221.1" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-9">
|
||||
<rect x="0" y="221.1" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-10">
|
||||
<rect x="0" y="245.5" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-10">
|
||||
<rect x="0" y="245.5" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-11">
|
||||
<rect x="0" y="269.9" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-11">
|
||||
<rect x="0" y="269.9" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-12">
|
||||
<rect x="0" y="294.3" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-12">
|
||||
<rect x="0" y="294.3" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-13">
|
||||
<rect x="0" y="318.7" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-13">
|
||||
<rect x="0" y="318.7" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-14">
|
||||
<rect x="0" y="343.1" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-14">
|
||||
<rect x="0" y="343.1" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
<clipPath id="terminal-649700464-line-15">
|
||||
<rect x="0" y="367.5" width="610" height="24.65"/>
|
||||
<clipPath id="terminal-2624234259-line-15">
|
||||
<rect x="0" y="367.5" width="561.2" height="24.65"/>
|
||||
</clipPath>
|
||||
</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-649700464-title" fill="#c6d0f5" text-anchor="middle" x="313" y="27">make help</text>
|
||||
<rect fill="#1e1e2e" stroke="rgba(255,255,255,0.35)" stroke-width="1" x="10.1667" y="1" width="578" height="462.8" rx="8"/><text class="terminal-2624234259-title" fill="#c6d0f5" text-anchor="middle" x="289" y="27">make help</text>
|
||||
<g transform="translate(32,22)">
|
||||
<circle cx="0" cy="0" r="7" fill="#ff5f57"/>
|
||||
<circle cx="22" cy="0" r="7" fill="#febc2e"/>
|
||||
<circle cx="44" cy="0" r="7" fill="#28c840"/>
|
||||
</g>
|
||||
|
||||
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-649700464-clip-terminal)">
|
||||
<g transform="translate(18.166666666666664, 41) scale(.95)" clip-path="url(#terminal-2624234259-clip-terminal)">
|
||||
|
||||
<g class="terminal-649700464-matrix">
|
||||
<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-649700464-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-649700464-line-1)">make <recipe></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-649700464-r2" x="610" y="68.8" textLength="12.2" clip-path="url(#terminal-649700464-line-2)">
|
||||
</text><text class="terminal-649700464-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-649700464-line-3)">  Turn your </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)"> 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-649700464-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-649700464-line-4)">  the </text><text class="terminal-649700464-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-649700464-line-4)">task runner</text><text class="terminal-649700464-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-649700464-line-4)"> you always 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-649700464-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-649700464-line-5)">  See the example output 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-649700464-r2" x="610" y="166.4" textLength="12.2" clip-path="url(#terminal-649700464-line-6)">
|
||||
</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)"> | </text><text class="terminal-649700464-r6" x="146.4" y="190.8" textLength="366" clip-path="url(#terminal-649700464-line-7)">generate local dev 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-649700464-r5" x="0" y="215.2" textLength="109.8" clip-path="url(#terminal-649700464-line-8)">     lint</text><text class="terminal-649700464-r2" x="109.8" y="215.2" textLength="36.6" clip-path="url(#terminal-649700464-line-8)"> | </text><text class="terminal-649700464-r6" x="146.4" y="215.2" textLength="183" clip-path="url(#terminal-649700464-line-8)">lint the 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-649700464-r5" x="0" y="239.6" textLength="109.8" clip-path="url(#terminal-649700464-line-9)">   assets</text><text class="terminal-649700464-r2" x="109.8" y="239.6" textLength="36.6" clip-path="url(#terminal-649700464-line-9)"> | </text><text class="terminal-649700464-r6" x="146.4" y="239.6" textLength="183" clip-path="url(#terminal-649700464-line-9)">generate 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-649700464-r5" x="0" y="264" textLength="109.8" clip-path="url(#terminal-649700464-line-10)">   list-%</text><text class="terminal-649700464-r2" x="109.8" y="264" textLength="36.6" clip-path="url(#terminal-649700464-line-10)"> | </text><text class="terminal-649700464-r6" x="146.4" y="264" textLength="366" clip-path="url(#terminal-649700464-line-10)">use pathlib.Path to list 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-649700464-r5" x="0" y="288.4" textLength="109.8" clip-path="url(#terminal-649700464-line-11)">  release</text><text class="terminal-649700464-r2" x="109.8" y="288.4" textLength="36.6" clip-path="url(#terminal-649700464-line-11)"> | </text><text class="terminal-649700464-r6" x="146.4" y="288.4" textLength="366" clip-path="url(#terminal-649700464-line-11)">release new version of 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-649700464-r5" x="0" y="312.8" textLength="109.8" clip-path="url(#terminal-649700464-line-12)"> c, clean</text><text class="terminal-649700464-r2" x="109.8" y="312.8" textLength="36.6" clip-path="url(#terminal-649700464-line-12)"> | </text><text class="terminal-649700464-r6" x="146.4" y="312.8" textLength="317.2" clip-path="url(#terminal-649700464-line-12)">remove the generated 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-649700464-r5" x="0" y="337.2" textLength="109.8" clip-path="url(#terminal-649700464-line-13)">     info</text><text class="terminal-649700464-r2" x="109.8" y="337.2" textLength="36.6" clip-path="url(#terminal-649700464-line-13)"> | </text><text class="terminal-649700464-r6" x="146.4" y="337.2" textLength="329.4" clip-path="url(#terminal-649700464-line-13)">demonstrate usage of 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-649700464-r5" x="0" y="361.6" textLength="109.8" clip-path="url(#terminal-649700464-line-14)">  h, help</text><text class="terminal-649700464-r2" x="109.8" y="361.6" textLength="36.6" clip-path="url(#terminal-649700464-line-14)"> | </text><text class="terminal-649700464-r6" x="146.4" y="361.6" textLength="170.8" clip-path="url(#terminal-649700464-line-14)">show this 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-649700464-r2" x="610" y="386" textLength="12.2" clip-path="url(#terminal-649700464-line-15)">
|
||||
</text><text class="terminal-649700464-r2" x="0" y="410.4" textLength="610" clip-path="url(#terminal-649700464-line-16)">for more info: see 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)">
|
||||
<g class="terminal-2624234259-matrix">
|
||||
<text class="terminal-2624234259-r1" x="0" y="20" textLength="73.2" clip-path="url(#terminal-2624234259-line-0)">usage:</text><text class="terminal-2624234259-r2" x="561.2" y="20" textLength="12.2" clip-path="url(#terminal-2624234259-line-0)">
|
||||
</text><text class="terminal-2624234259-r2" x="97.6" y="44.4" textLength="158.6" clip-path="url(#terminal-2624234259-line-1)">make <recipe></text><text class="terminal-2624234259-r2" x="561.2" y="44.4" textLength="12.2" clip-path="url(#terminal-2624234259-line-1)">
|
||||
</text><text class="terminal-2624234259-r2" x="561.2" y="68.8" textLength="12.2" clip-path="url(#terminal-2624234259-line-2)">
|
||||
</text><text class="terminal-2624234259-r2" x="0" y="93.2" textLength="146.4" clip-path="url(#terminal-2624234259-line-3)">  Turn your </text><text class="terminal-2624234259-r3" x="146.4" y="93.2" textLength="122" clip-path="url(#terminal-2624234259-line-3)">`Makefile`</text><text class="terminal-2624234259-r2" x="268.4" y="93.2" textLength="61" clip-path="url(#terminal-2624234259-line-3)"> into</text><text class="terminal-2624234259-r2" x="561.2" y="93.2" textLength="12.2" clip-path="url(#terminal-2624234259-line-3)">
|
||||
</text><text class="terminal-2624234259-r2" x="0" y="117.6" textLength="73.2" clip-path="url(#terminal-2624234259-line-4)">  the </text><text class="terminal-2624234259-r4" x="73.2" y="117.6" textLength="134.2" clip-path="url(#terminal-2624234259-line-4)">task runner</text><text class="terminal-2624234259-r2" x="207.4" y="117.6" textLength="231.8" clip-path="url(#terminal-2624234259-line-4)"> you always needed.</text><text class="terminal-2624234259-r2" x="561.2" y="117.6" textLength="12.2" clip-path="url(#terminal-2624234259-line-4)">
|
||||
</text><text class="terminal-2624234259-r2" x="0" y="142" textLength="378.2" clip-path="url(#terminal-2624234259-line-5)">  See the example output below.</text><text class="terminal-2624234259-r2" x="561.2" y="142" textLength="12.2" clip-path="url(#terminal-2624234259-line-5)">
|
||||
</text><text class="terminal-2624234259-r2" x="561.2" y="166.4" textLength="12.2" clip-path="url(#terminal-2624234259-line-6)">
|
||||
</text><text class="terminal-2624234259-r5" x="0" y="190.8" textLength="109.8" clip-path="url(#terminal-2624234259-line-7)">bootstrap</text><text class="terminal-2624234259-r2" x="109.8" y="190.8" textLength="36.6" clip-path="url(#terminal-2624234259-line-7)"> | </text><text class="terminal-2624234259-r6" x="146.4" y="190.8" textLength="366" clip-path="url(#terminal-2624234259-line-7)">generate local dev environment</text><text class="terminal-2624234259-r2" x="561.2" y="190.8" textLength="12.2" clip-path="url(#terminal-2624234259-line-7)">
|
||||
</text><text class="terminal-2624234259-r5" x="0" y="215.2" textLength="109.8" clip-path="url(#terminal-2624234259-line-8)">     lint</text><text class="terminal-2624234259-r2" x="109.8" y="215.2" textLength="36.6" clip-path="url(#terminal-2624234259-line-8)"> | </text><text class="terminal-2624234259-r6" x="146.4" y="215.2" textLength="183" clip-path="url(#terminal-2624234259-line-8)">lint the python</text><text class="terminal-2624234259-r2" x="561.2" y="215.2" textLength="12.2" clip-path="url(#terminal-2624234259-line-8)">
|
||||
</text><text class="terminal-2624234259-r5" x="0" y="239.6" textLength="109.8" clip-path="url(#terminal-2624234259-line-9)">   assets</text><text class="terminal-2624234259-r2" x="109.8" y="239.6" textLength="36.6" clip-path="url(#terminal-2624234259-line-9)"> | </text><text class="terminal-2624234259-r6" x="146.4" y="239.6" textLength="183" clip-path="url(#terminal-2624234259-line-9)">generate assets</text><text class="terminal-2624234259-r2" x="561.2" y="239.6" textLength="12.2" clip-path="url(#terminal-2624234259-line-9)">
|
||||
</text><text class="terminal-2624234259-r5" x="0" y="264" textLength="109.8" clip-path="url(#terminal-2624234259-line-10)">   list-%</text><text class="terminal-2624234259-r2" x="109.8" y="264" textLength="36.6" clip-path="url(#terminal-2624234259-line-10)"> | </text><text class="terminal-2624234259-r6" x="146.4" y="264" textLength="366" clip-path="url(#terminal-2624234259-line-10)">use pathlib.Path to list files</text><text class="terminal-2624234259-r2" x="561.2" y="264" textLength="12.2" clip-path="url(#terminal-2624234259-line-10)">
|
||||
</text><text class="terminal-2624234259-r5" x="0" y="288.4" textLength="109.8" clip-path="url(#terminal-2624234259-line-11)">  release</text><text class="terminal-2624234259-r2" x="109.8" y="288.4" textLength="36.6" clip-path="url(#terminal-2624234259-line-11)"> | </text><text class="terminal-2624234259-r6" x="146.4" y="288.4" textLength="366" clip-path="url(#terminal-2624234259-line-11)">release new version of task.mk</text><text class="terminal-2624234259-r2" x="561.2" y="288.4" textLength="12.2" clip-path="url(#terminal-2624234259-line-11)">
|
||||
</text><text class="terminal-2624234259-r5" x="0" y="312.8" textLength="109.8" clip-path="url(#terminal-2624234259-line-12)"> c, clean</text><text class="terminal-2624234259-r2" x="109.8" y="312.8" textLength="36.6" clip-path="url(#terminal-2624234259-line-12)"> | </text><text class="terminal-2624234259-r6" x="146.4" y="312.8" textLength="317.2" clip-path="url(#terminal-2624234259-line-12)">remove the generated files</text><text class="terminal-2624234259-r2" x="561.2" y="312.8" textLength="12.2" clip-path="url(#terminal-2624234259-line-12)">
|
||||
</text><text class="terminal-2624234259-r5" x="0" y="337.2" textLength="109.8" clip-path="url(#terminal-2624234259-line-13)">     info</text><text class="terminal-2624234259-r2" x="109.8" y="337.2" textLength="36.6" clip-path="url(#terminal-2624234259-line-13)"> | </text><text class="terminal-2624234259-r6" x="146.4" y="337.2" textLength="329.4" clip-path="url(#terminal-2624234259-line-13)">demonstrate usage of tprint</text><text class="terminal-2624234259-r2" x="561.2" y="337.2" textLength="12.2" clip-path="url(#terminal-2624234259-line-13)">
|
||||
</text><text class="terminal-2624234259-r5" x="0" y="361.6" textLength="109.8" clip-path="url(#terminal-2624234259-line-14)">  h, help</text><text class="terminal-2624234259-r2" x="109.8" y="361.6" textLength="36.6" clip-path="url(#terminal-2624234259-line-14)"> | </text><text class="terminal-2624234259-r6" x="146.4" y="361.6" textLength="170.8" clip-path="url(#terminal-2624234259-line-14)">show this help</text><text class="terminal-2624234259-r2" x="561.2" y="361.6" textLength="12.2" clip-path="url(#terminal-2624234259-line-14)">
|
||||
</text><text class="terminal-2624234259-r2" x="561.2" y="386" textLength="12.2" clip-path="url(#terminal-2624234259-line-15)">
|
||||
</text><text class="terminal-2624234259-r2" x="0" y="410.4" textLength="561.2" clip-path="url(#terminal-2624234259-line-16)">for more info: github.com/daylinmorgan/task.mk</text><text class="terminal-2624234259-r2" x="561.2" y="410.4" textLength="12.2" clip-path="url(#terminal-2624234259-line-16)">
|
||||
</text>
|
||||
</g>
|
||||
</g>
|
||||
|
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
|
@ -5,8 +5,7 @@
|
|||
|
||||
codes_names = {
|
||||
getattr(ansi, attr): attr
|
||||
for attr in dir(ansi)
|
||||
if attr[0:1] != "_" and attr != "end" and attr != "setcode"
|
||||
for attr in ansi.__dict__
|
||||
}
|
||||
for code in sorted(codes_names.keys(), key=lambda item: (len(item), item)):
|
||||
print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end))
|
||||
|
|
|
@ -7,30 +7,22 @@ define \n
|
|||
endef
|
||||
|
||||
escape_shellstring = $(subst `,\`,$(subst ",\",$(subst $$,\$$,$(subst \,\\,$1))))
|
||||
|
||||
escape_printf = $(subst \,\\,$(subst %,%%,$1))
|
||||
|
||||
create_string = $(subst $(\n),\n,$(call escape_shellstring,$(call escape_printf,$1)))
|
||||
|
||||
|
||||
ifdef DEBUG
|
||||
define py
|
||||
@printf "Python Script:\n"
|
||||
@printf -- "----------------\n"
|
||||
@printf "$(call create_string,$($(1)))\n"
|
||||
@printf -- "----------------\n"
|
||||
@printf "$(call create_string,$($(1)))" | python3
|
||||
endef
|
||||
define tbash
|
||||
@printf "Bash Script:\n"
|
||||
@printf -- "----------------\n"
|
||||
@printf "$(call create_string,$($(1)))\n"
|
||||
@printf -- "----------------\n"
|
||||
@printf "$(call create_string,$($(1)))" | bash
|
||||
define _debug_runner
|
||||
@printf "$(1) Script:\n"
|
||||
@printf -- "<---------------->\n"
|
||||
@printf "$(call create_string,$(3))\n"
|
||||
@printf -- "<---------------->\n"
|
||||
@printf "$(call create_string,$(3))" | $(2)
|
||||
endef
|
||||
py = $(call _debug_runner,Python,python3,$($(1)))
|
||||
tbash = $(call _debug_runner,Bash,bash,$($(1)))
|
||||
else
|
||||
py = @printf "$(call create_string,$($(1)))" | python3
|
||||
tbash = @printf "$(call create_string,$($(1)))" | bash
|
||||
endif
|
||||
|
||||
pysh = printf "$(call create_string,$($(1)))" | python3
|
||||
pysh = printf "$(call create_string,$($(1)))" | python3
|
||||
|
|
29
task.mk
29
task.mk
|
@ -1,7 +1,7 @@
|
|||
# }> [github.com/daylinmorgan/task.mk] <{ #
|
||||
# Copyright (c) 2022 Daylin Morgan
|
||||
# MIT License
|
||||
# version: 22.9.7
|
||||
# version: v22.9.7-4-gd395d7e-dev
|
||||
#
|
||||
# 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.
|
||||
|
@ -70,27 +70,19 @@ define \n
|
|||
endef
|
||||
|
||||
escape_shellstring = $(subst `,\`,$(subst ",\",$(subst $$,\$$,$(subst \,\\,$1))))
|
||||
|
||||
escape_printf = $(subst \,\\,$(subst %,%%,$1))
|
||||
|
||||
create_string = $(subst $(\n),\n,$(call escape_shellstring,$(call escape_printf,$1)))
|
||||
|
||||
|
||||
ifdef DEBUG
|
||||
define py
|
||||
@printf "Python Script:\n"
|
||||
@printf -- "----------------\n"
|
||||
@printf "$(call create_string,$($(1)))\n"
|
||||
@printf -- "----------------\n"
|
||||
@printf "$(call create_string,$($(1)))" | python3
|
||||
endef
|
||||
define tbash
|
||||
@printf "Bash Script:\n"
|
||||
@printf -- "----------------\n"
|
||||
@printf "$(call create_string,$($(1)))\n"
|
||||
@printf -- "----------------\n"
|
||||
@printf "$(call create_string,$($(1)))" | bash
|
||||
define _debug_runner
|
||||
@printf "$(1) Script:\n"
|
||||
@printf -- "<---------------->\n"
|
||||
@printf "$(call create_string,$(3))\n"
|
||||
@printf -- "<---------------->\n"
|
||||
@printf "$(call create_string,$(3))" | $(2)
|
||||
endef
|
||||
py = $(call _debug_runner,Python,python3,$($(1)))
|
||||
tbash = $(call _debug_runner,Bash,bash,$($(1)))
|
||||
else
|
||||
py = @printf "$(call create_string,$($(1)))" | python3
|
||||
tbash = @printf "$(call create_string,$($(1)))" | bash
|
||||
|
@ -240,8 +232,7 @@ $(ansi_py)
|
|||
|
||||
codes_names = {
|
||||
getattr(ansi, attr): attr
|
||||
for attr in dir(ansi)
|
||||
if attr[0:1] != "_" and attr != "end" and attr != "setcode"
|
||||
for attr in ansi.__dict__
|
||||
}
|
||||
for code in sorted(codes_names.keys(), key=lambda item: (len(item), item)):
|
||||
print("{:>20} {}".format(codes_names[code], code + "******" + ansi.end))
|
||||
|
|
Loading…
Reference in a new issue