From 5c65cae578320e298e13c6cddc2603a503a5ac99 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Thu, 19 Jan 2023 12:23:34 -0600 Subject: [PATCH] refactor: use TASKMK_DEBUG instead of DEBUG --- docs/usage.md | 2 +- src/runners.mk | 2 +- task.mk | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 3ddaf92..a796c5a 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -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. `$(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 define list_files_py diff --git a/src/runners.mk b/src/runners.mk index 200a09f..5cb406b 100644 --- a/src/runners.mk +++ b/src/runners.mk @@ -8,7 +8,7 @@ _escape_shellstring = $(subst `,\`,$(subst ",\",$(subst $$,\$$,$(subst \,\\,$1)) _escape_printf = $(subst \,\\,$(subst %,%%,$1)) _create_string = $(subst $(_newline),\n,$(call _escape_shellstring,$(call _escape_printf,$1))) _printline = printf -- "<----------------------------------->\n" -ifdef DEBUG +ifdef TASKMK_DEBUG define _debug_runner @printf "$(1) Script:\n";$(_printline); @printf "$(call _create_string,$(3))\n" | cat -n diff --git a/task.mk b/task.mk index 80f8c3b..f077f19 100644 --- a/task.mk +++ b/task.mk @@ -1,7 +1,7 @@ # }> [github.com/daylinmorgan/task.mk] <{ # # Copyright (c) 2022 Daylin Morgan # 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` # 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)) _create_string = $(subst $(_newline),\n,$(call _escape_shellstring,$(call _escape_printf,$1))) _printline = printf -- "<----------------------------------->\n" -ifdef DEBUG +ifdef TASKMK_DEBUG define _debug_runner @printf "$(1) Script:\n";$(_printline); @printf "$(call _create_string,$(3))\n" | cat -n