Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 22 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,30 @@ install-precommit: $(GIT_HOOKS) ## Sets up pre-commit hooks
$(GIT_HOOKS): .pre-commit-config.yaml
$(PRECOMMIT) install

.PHONY: does-path-have-reqs
does-path-have-reqs: ## Check if shell $PATH has expected elements
@echo "$(COLOR_BLUE)Checking PATH elements for evidence of package managers…$(COLOR_RESET)"
@( (echo $${PATH} | grep -q poetry ) && echo "found poetry") || (echo "missing poetry" && false)
@( (echo $${PATH} | grep -q homebrew ) && echo "found homebrew") || (echo "missing homebrew" && false)
@( (echo $${PATH} | grep -q pyenv ) && echo "found pyenv") || (echo "missing pyenv" && false)
.PHONY: deps-reqs-versions
deps-reqs-versions: ## Check if shell $PATH has requirements and show their version
@echo "$(COLOR_BLUE)Checking PATH elements for evidence of required tools. The first in each section is what's used.$(COLOR_RESET)"
@$(MAKE) paths-version-for-cmd CMD=poetry
@$(MAKE) paths-version-for-cmd CMD=pyenv
@$(MAKE) paths-version-for-cmd CMD=brew
@$(MAKE) paths-version-for-cmd CMD=curl
@$(MAKE) paths-version-for-cmd CMD=git
@$(MAKE) paths-version-for-cmd CMD=pre-commit
@echo "$(COLOR_GREEN)All expected PATH elements found$(COLOR_RESET)"

CMD_VERSION_FLAG ?= --version
WHICH ?= which
.PHONY: paths-version-for-cmd
paths-version-for-cmd: ## Display version for all executable paths for an executable, set CMD & CMD_VERSION_FLAG
@( if [ -z "$$(which -a $(CMD))" ]; then \
echo "==> $(COLOR_RED)missing $(CMD)$(COLOR_RESET)"; \
else \
echo "==> $(COLOR_ORANGE)$(CMD) $(COLOR_BLUE)commands' versions are:$(COLOR_RESET)"; \
for pth in $$($(WHICH) -a $(CMD)); do \
echo "$(COLOR_BLUE)$${pth}$(COLOR_RESET) : $$("$${pth}" $(CMD_VERSION_FLAG))"; \
done; \
fi )

##@ Dependencies

.PHONY: python-current
Expand Down
Loading