kopia lustrzana https://github.com/jedie/PyInventory
Speedup make usage
Con't get the version information on every call to speedup the make usage.pull/8/head
rodzic
bfd622cadf
commit
98c6eaadf2
14
Makefile
14
Makefile
|
@ -1,15 +1,13 @@
|
|||
SHELL := /bin/bash
|
||||
MAX_LINE_LENGTH := 119
|
||||
POETRY_VERSION := $(shell poetry --version 2>/dev/null)
|
||||
COMPOSE_VERSION := $(shell poetry run docker-compose --version 2>/dev/null)
|
||||
|
||||
help: ## List all commands
|
||||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9 -]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
|
||||
check-poetry:
|
||||
@if [[ "${POETRY_VERSION}" == *"Poetry"* ]] ; \
|
||||
@if [[ "$(shell poetry --version 2>/dev/null)" == *"Poetry"* ]] ; \
|
||||
then \
|
||||
echo "Found ${POETRY_VERSION}, ok." ; \
|
||||
echo "Poetry found, ok." ; \
|
||||
else \
|
||||
echo 'Please install poetry first, with e.g.:' ; \
|
||||
echo 'make install-poetry' ; \
|
||||
|
@ -17,9 +15,9 @@ check-poetry:
|
|||
fi
|
||||
|
||||
install-poetry: ## install or update poetry
|
||||
@if [[ "${POETRY_VERSION}" == *"Poetry"* ]] ; \
|
||||
@if [[ "$(shell poetry --version 2>/dev/null)" == *"Poetry"* ]] ; \
|
||||
then \
|
||||
echo 'Update poetry v$(POETRY_VERSION)' ; \
|
||||
echo 'Update poetry' ; \
|
||||
poetry self update ; \
|
||||
else \
|
||||
echo 'Install poetry' ; \
|
||||
|
@ -96,9 +94,9 @@ create-starter: ## Create starter file.
|
|||
|
||||
|
||||
check-compose:
|
||||
@if [[ "${COMPOSE_VERSION}" == *"docker-compose version"* ]] ; \
|
||||
@if [[ "$(shell poetry run docker-compose --version 2>/dev/null)" = *"docker-compose version"* ]] ; \
|
||||
then \
|
||||
echo "Found ${COMPOSE_VERSION}, ok." ; \
|
||||
echo "docker-compose found, ok." ; \
|
||||
else \
|
||||
echo 'Please install extras first, with e.g.:' ; \
|
||||
echo 'make install-compose' ; \
|
||||
|
|
Ładowanie…
Reference in New Issue