mirror of
https://github.com/daylinmorgan/task.mk.git
synced 2024-12-21 17:40:45 -06:00
refactor: use TASKMK_DEBUG instead of DEBUG
This commit is contained in:
parent
83fe41dbe4
commit
5c65cae578
3 changed files with 4 additions and 4 deletions
|
@ -87,7 +87,7 @@ 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.
|
When `make` expands the function it will take the parameters passed to `py` and expand them.
|
||||||
`$(1)` is the variable name and `$(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 `TASKMK_DEBUG=1` when you run `make` and it will first print the script that will be piped to `python`.
|
||||||
|
|
||||||
```make
|
```make
|
||||||
define list_files_py
|
define list_files_py
|
||||||
|
|
|
@ -8,7 +8,7 @@ _escape_shellstring = $(subst `,\`,$(subst ",\",$(subst $$,\$$,$(subst \,\\,$1))
|
||||||
_escape_printf = $(subst \,\\,$(subst %,%%,$1))
|
_escape_printf = $(subst \,\\,$(subst %,%%,$1))
|
||||||
_create_string = $(subst $(_newline),\n,$(call _escape_shellstring,$(call _escape_printf,$1)))
|
_create_string = $(subst $(_newline),\n,$(call _escape_shellstring,$(call _escape_printf,$1)))
|
||||||
_printline = printf -- "<----------------------------------->\n"
|
_printline = printf -- "<----------------------------------->\n"
|
||||||
ifdef DEBUG
|
ifdef TASKMK_DEBUG
|
||||||
define _debug_runner
|
define _debug_runner
|
||||||
@printf "$(1) Script:\n";$(_printline);
|
@printf "$(1) Script:\n";$(_printline);
|
||||||
@printf "$(call _create_string,$(3))\n" | cat -n
|
@printf "$(call _create_string,$(3))\n" | cat -n
|
||||||
|
|
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
|
||||||
# version: v22.9.28-4-gbf0394c-dev
|
# version: v22.9.28-5-g83fe41d-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.
|
||||||
|
@ -64,7 +64,7 @@ _escape_shellstring = $(subst `,\`,$(subst ",\",$(subst $$,\$$,$(subst \,\\,$1))
|
||||||
_escape_printf = $(subst \,\\,$(subst %,%%,$1))
|
_escape_printf = $(subst \,\\,$(subst %,%%,$1))
|
||||||
_create_string = $(subst $(_newline),\n,$(call _escape_shellstring,$(call _escape_printf,$1)))
|
_create_string = $(subst $(_newline),\n,$(call _escape_shellstring,$(call _escape_printf,$1)))
|
||||||
_printline = printf -- "<----------------------------------->\n"
|
_printline = printf -- "<----------------------------------->\n"
|
||||||
ifdef DEBUG
|
ifdef TASKMK_DEBUG
|
||||||
define _debug_runner
|
define _debug_runner
|
||||||
@printf "$(1) Script:\n";$(_printline);
|
@printf "$(1) Script:\n";$(_printline);
|
||||||
@printf "$(call _create_string,$(3))\n" | cat -n
|
@printf "$(call _create_string,$(3))\n" | cat -n
|
||||||
|
|
Loading…
Reference in a new issue