mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-22 01:50:44 -06:00
refactor: use more informative syntac for tprint (-sh vs -verbose)
This commit is contained in:
parent
13ea08104d
commit
e32279d494
4 changed files with 6 additions and 6 deletions
4
Makefile
4
Makefile
|
@ -45,10 +45,10 @@ c clean: ## remove the generated files
|
||||||
|
|
||||||
define version_check_sh
|
define version_check_sh
|
||||||
if [[ "${VERSION}" == *'-'* ]]; then
|
if [[ "${VERSION}" == *'-'* ]]; then
|
||||||
$(call tprint-sh,{a.red}VERSION INVALID!{a.end} Uncommited or untagged work)
|
$(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\
|
elif [[ $(shell echo "${VERSION}" | awk -F. '{ print NF }') -lt 3 ]];then\
|
||||||
$(call tprint-sh,{a.red}VERSION INVALID!{a.end} Expected CalVer string)
|
$(call tprint-verbose,{a.red}VERSION INVALID!{a.end} Expected CalVer string)
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
endef
|
endef
|
||||||
|
|
|
@ -19,7 +19,7 @@ _print-ansi: ## show all possible ansi color code combinations
|
||||||
$(call py,print_ansi_py)
|
$(call py,print_ansi_py)
|
||||||
# functions to take f-string literals and pass to python print
|
# functions to take f-string literals and pass to python print
|
||||||
tprint = $(call py,print_py,$(1))
|
tprint = $(call py,print_py,$(1))
|
||||||
tprint-sh = $(call pysh,print_py,$(1))
|
tprint-verbose= $(call py-verbose,print_py,$(1))
|
||||||
tconfirm = $(call py,confirm_py,$(1))
|
tconfirm = $(call py,confirm_py,$(1))
|
||||||
_update-task.mk: ## downloads version of task.mk (TASKMK_VERSION=)
|
_update-task.mk: ## downloads version of task.mk (TASKMK_VERSION=)
|
||||||
$(call tprint,{a.b_cyan}Updating task.mk{a.end})
|
$(call tprint,{a.b_cyan}Updating task.mk{a.end})
|
||||||
|
|
|
@ -21,4 +21,4 @@ else
|
||||||
py = @python3 <(printf "$(call _create_string,$($(1)))")
|
py = @python3 <(printf "$(call _create_string,$($(1)))")
|
||||||
tbash = @bash <(printf "$(call _create_string,$($(1)))")
|
tbash = @bash <(printf "$(call _create_string,$($(1)))")
|
||||||
endif
|
endif
|
||||||
pysh = python3 <(printf "$(call _create_string,$($(1)))")
|
py-verbose = python3 <(printf "$(call _create_string,$($(1)))")
|
||||||
|
|
4
task.mk
4
task.mk
|
@ -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
|
||||||
TASKMK_VERSION ?= v22.9.28-18-g3873df0-dev
|
TASKMK_VERSION ?= v22.9.28-19-g13ea081-dev
|
||||||
# task.mk should be included at the bottom of your Makefile with `-include .task.mk`
|
# 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.
|
# 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`
|
# You can update your .task.mk with `make _update-task.mk`
|
||||||
|
@ -73,7 +73,7 @@ else
|
||||||
py = @python3 <(printf "$(call _create_string,$($(1)))")
|
py = @python3 <(printf "$(call _create_string,$($(1)))")
|
||||||
tbash = @bash <(printf "$(call _create_string,$($(1)))")
|
tbash = @bash <(printf "$(call _create_string,$($(1)))")
|
||||||
endif
|
endif
|
||||||
pysh = python3 <(printf "$(call _create_string,$($(1)))")
|
py-verbose = python3 <(printf "$(call _create_string,$($(1)))")
|
||||||
# ---- [python scripts] ---- #
|
# ---- [python scripts] ---- #
|
||||||
define help_py
|
define help_py
|
||||||
import argparse
|
import argparse
|
||||||
|
|
Loading…
Reference in a new issue