From 13ea08104dd798f555574d39612e62c25517ed6c Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 20 Jan 2023 12:35:52 -0600 Subject: [PATCH] feat: use version in _update-task.mk --- Makefile | 2 +- src/builtins.mk | 4 ++-- src/header.mk | 3 +-- task.mk | 9 ++++----- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index d5d1d9b..a66b3ff 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION ?= $(shell git describe --tags --always --dirty=dev) +VERSION ?= $(shell git describe --tags --always --dirty=-dev) TEMPLATES := $(shell find src/ -type f) .DEFAULT_GOAL := help msg = $(if $(tprint),$(call tprint,{a.bold}==> {a.magenta}$(1){a.end}),@echo '==> $(1)') diff --git a/src/builtins.mk b/src/builtins.mk index fb12182..562afce 100644 --- a/src/builtins.mk +++ b/src/builtins.mk @@ -21,9 +21,9 @@ _print-ansi: ## show all possible ansi color code combinations tprint = $(call py,print_py,$(1)) tprint-sh = $(call pysh,print_py,$(1)) tconfirm = $(call py,confirm_py,$(1)) -_update-task.mk: ## downloads latest development version of task.mk +_update-task.mk: ## downloads version of task.mk (TASKMK_VERSION=) $(call tprint,{a.b_cyan}Updating task.mk{a.end}) - curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk + curl https://raw.githubusercontent.com/daylinmorgan/task.mk/$(TASKMK_VERSION)/task.mk -o .task.mk .PHONY: h help _help _print-ansi _update-task.mk TASK_MAKEFILE_LIST := $(filter-out $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)),$(MAKEFILE_LIST)) export MAKEFILE_LIST MAKE TASK_MAKEFILE_LIST diff --git a/src/header.mk b/src/header.mk index 93dc499..cbd20dd 100644 --- a/src/header.mk +++ b/src/header.mk @@ -1,8 +1,7 @@ # }> [github.com/daylinmorgan/task.mk] <{ # # Copyright (c) 2022 Daylin Morgan # MIT License -# version: ##- version -## -# +TASKMK_VERSION ?= ##- version -## # 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` diff --git a/task.mk b/task.mk index c2224d7..8fc3916 100644 --- a/task.mk +++ b/task.mk @@ -1,8 +1,7 @@ # }> [github.com/daylinmorgan/task.mk] <{ # # Copyright (c) 2022 Daylin Morgan # MIT License -# version: v22.9.28-17-g365e0e1dev -# +TASKMK_VERSION ?= v22.9.28-18-g3873df0-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. # You can update your .task.mk with `make _update-task.mk` @@ -41,11 +40,11 @@ _print-ansi: ## show all possible ansi color code combinations $(call py,print_ansi_py) # functions to take f-string literals and pass to python print 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)) -_update-task.mk: ## downloads latest development version of task.mk +_update-task.mk: ## downloads version of task.mk (TASKMK_VERSION=) $(call tprint,{a.b_cyan}Updating task.mk{a.end}) - curl https://raw.githubusercontent.com/daylinmorgan/task.mk/main/task.mk -o .task.mk + curl https://raw.githubusercontent.com/daylinmorgan/task.mk/$(TASKMK_VERSION)/task.mk -o .task.mk .PHONY: h help _help _print-ansi _update-task.mk TASK_MAKEFILE_LIST := $(filter-out $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)),$(MAKEFILE_LIST)) export MAKEFILE_LIST MAKE TASK_MAKEFILE_LIST