mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-22 18:00:44 -06:00
Compare commits
4 commits
18dfd8b5e5
...
891e4133aa
Author | SHA1 | Date | |
---|---|---|---|
891e4133aa | |||
860a5031a9 | |||
1ecc7f9f34 | |||
2f9173871b |
6 changed files with 14 additions and 16 deletions
3
Makefile
3
Makefile
|
@ -44,9 +44,6 @@ if git rev-parse -q --verify "refs/tags/${VERSION}" >/dev/null; then
|
|||
elif [[ "${VERSION}" == *'-'* ]]; then
|
||||
$(call tprint-verbose,{a.red}VERSION INVALID!{a.end} Uncommited or untagged work); exit 1;
|
||||
exit 1
|
||||
elif [[ $(shell echo "${VERSION}" | awk -F. '{ print NF }') -lt 3 ]];then\
|
||||
$(call tprint-verbose,{a.red}VERSION INVALID!{a.end} Expected CalVer string)
|
||||
exit 1
|
||||
fi
|
||||
endef
|
||||
|
||||
|
|
11
README.md
11
README.md
|
@ -13,8 +13,9 @@
|
|||
GNU make is an excellent build tool and the task runner we love to hate, but can't escape.
|
||||
So let's improve the UX to make it the best task runner it can be.
|
||||
|
||||
`Task.mk`, is a standalone `Makefile` you can deploy alongside your own
|
||||
to add some QOL improvements for your users and fellow maintainers.
|
||||
`Task.mk`, is a standalone `Makefile` powered by a little magic (code golfing `python` inside of `make`) and little luck (absurd string manipulation and regexes).
|
||||
You can deploy it alongside your own to add some QOL improvements for your users and fellow maintainers.
|
||||
|
||||
|
||||
Current Features:
|
||||
|
||||
|
@ -27,7 +28,7 @@ Current Features:
|
|||
Depends on `GNU Make`, obviously and `Python >=3.7`, and `bash` (or `zsh`).
|
||||
|
||||
Wait python?!?!, I'm not `pip` installing some package just to parse my makefile.
|
||||
I agree, all you need is one file [`.task.mk`](https://github.com/daylinmorgan/task.mk/blob/main/task.mk)
|
||||
I agree, all you need is one file [`.task.mk`](https://github.com/daylinmorgan/task.mk/v2024.1001/task.mk)
|
||||
You can automagically include it with just two additional lines to your `Makefile` (and probably one to your `.gitignore`) and you're good to go.
|
||||
|
||||
## Setup
|
||||
|
@ -42,14 +43,14 @@ If someone tries to invoke `make help` it will download `.task.mk` for them.
|
|||
|
||||
```make
|
||||
-include .task.mk
|
||||
$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v23.1.2/task.mk -o .task.mk))
|
||||
$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v2024.1001/task.mk -o .task.mk))
|
||||
```
|
||||
|
||||
If you plan to use any features besides the help prompt you may want to instead commit `.task.mk` to version control or drop the `$(MAKECMDGOALS)` check so it's always downloaded once `make` is invoked.
|
||||
|
||||
```make
|
||||
-include .task.mk
|
||||
$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v23.1.2/task.mk -o .task.mk)
|
||||
$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v2024.1001/task.mk -o .task.mk)
|
||||
```
|
||||
|
||||
For more info see the [documentation](https://gh.dayl.in/task.mk).
|
||||
|
|
|
@ -27,7 +27,7 @@ Current Features:
|
|||
Depends on `GNU Make`, obviously and `Python >=3.7`, and `bash` (or `zsh`).
|
||||
|
||||
Wait python?!?!, I'm not `pip` installing some package just to parse my makefile.
|
||||
I agree, all you need is one file [`.task.mk`](https://github.com/daylinmorgan/task.mk/blob/main/task.mk)
|
||||
I agree, all you need is one file [`.task.mk`](https://github.com/daylinmorgan/task.mk/v2024.1001/task.mk)
|
||||
You can automagically include it with just two additional lines to your `Makefile` (and probably one to your `.gitignore`) and you're good to go.
|
||||
|
||||
## Setup
|
||||
|
@ -42,14 +42,14 @@ If someone tries to invoke `make help` it will download `.task.mk` for them.
|
|||
|
||||
```make
|
||||
-include .task.mk
|
||||
$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v23.1.2/task.mk -o .task.mk))
|
||||
$(if $(filter help,$(MAKECMDGOALS)),$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v2024.1001/task.mk -o .task.mk))
|
||||
```
|
||||
|
||||
If you plan to use any features besides the help prompt you may want to instead commit `.task.mk` to version control or drop the `$(MAKECMDGOALS)` check so it's always downloaded once `make` is invoked.
|
||||
|
||||
```make
|
||||
-include .task.mk
|
||||
$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v23.1.2/task.mk -o .task.mk)
|
||||
$(if $(wildcard .task.mk),,.task.mk: ; curl -fsSL https://raw.githubusercontent.com/daylinmorgan/task.mk/v2024.1001/task.mk -o .task.mk)
|
||||
```
|
||||
|
||||
For more info see the [documentation](https://gh.dayl.in/task.mk).
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
LATEST_TASKMK_VERSION="v23.1.2"
|
||||
LATEST_TASKMK_VERSION="v2024.1001"
|
||||
VERSION=${TASKMK_VERSION:-$LATEST_TASKMK_VERSION}
|
||||
printf "Initializing Task.mk (%s) for repo\n" "$VERSION"
|
||||
if [ -f "./.task.mk" ]; then
|
||||
|
|
|
@ -11,4 +11,4 @@ WRAP ?= 100
|
|||
# python f-string literals
|
||||
EPILOG ?=
|
||||
USAGE ?={ansi.header}usage{ansi.end}:\n make <recipe>\n
|
||||
PHONIFY ?=
|
||||
PHONIFY ?= 1
|
||||
|
|
4
task.mk
4
task.mk
|
@ -1,7 +1,7 @@
|
|||
# }> [github.com/daylinmorgan/task.mk] <{ #
|
||||
# Copyright (c) 2022 Daylin Morgan
|
||||
# MIT License
|
||||
TASKMK_VERSION ?= 23.1.2
|
||||
TASKMK_VERSION ?= 2024.1001
|
||||
# task.mk should be included at the bottom of your Makefile with `-include .task.mk`
|
||||
# See below for the standard configuration options that should be set prior to including this file.
|
||||
# You can update your .task.mk with `make _update-task.mk`
|
||||
|
@ -19,7 +19,7 @@ WRAP ?= 100
|
|||
# python f-string literals
|
||||
EPILOG ?=
|
||||
USAGE ?={ansi.header}usage{ansi.end}:\n make <recipe>\n
|
||||
PHONIFY ?=
|
||||
PHONIFY ?= 1
|
||||
# ---- [python scripts] ---- #
|
||||
define help_py
|
||||
from collections import namedtuple
|
||||
|
|
Loading…
Reference in a new issue