Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a help part into Makefile #93

Closed
2 tasks
Arfey opened this issue Apr 18, 2019 · 0 comments · Fixed by #117
Closed
2 tasks

Add a help part into Makefile #93

Arfey opened this issue Apr 18, 2019 · 0 comments · Fixed by #117
Labels
easy Easy for first pull request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Arfey
Copy link
Member

Arfey commented Apr 18, 2019

  • corrected make files
  • add help command to doc and readme

image

# colors
GREEN = $(shell tput -Txterm setaf 2)
YELLOW = $(shell tput -Txterm setaf 3)
WHITE = $(shell tput -Txterm setaf 7)
RESET = $(shell tput -Txterm sgr0)
GRAY = $(shell tput -Txterm setaf 6)
TARGET_MAX_CHAR_NUM = 20

help:
	@echo ''
	@echo 'Usage:'
	@echo ''
	@echo '  ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
	@echo ''
	@echo 'Targets:'
	@awk '/^[a-zA-Z\-\_0-9]+:/ { \
		helpMessage = match(lastLine, /^## (.*)/); \
		if (helpMessage) { \
		    if (index(lastLine, "|") != 0) { \
				stage = substr(lastLine, index(lastLine, "|") + 1); \
				printf "\n ${GRAY}%s: \n\n", stage;  \
			} \
			helpCommand = substr($$1, 0, index($$1, ":")-1); \
			helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
			if (index(lastLine, "|") != 0) { \
				helpMessage = substr(helpMessage, 0, index(helpMessage, "|")-1); \
			} \
			printf "  ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \
		} \
	} \
	{ lastLine = $$0 }' $(MAKEFILE_LIST)
	@echo ''

Makefile

## Run all resources for developing (without celery) | develop
all:
	docker-compose  up app assets-js

## Run the application
app:
	docker-compose  up app

## Run tests for application | test
test:
	docker-compose up app-test
@Arfey Arfey added good first issue Good for newcomers help wanted Extra attention is needed easy Easy for first pull request labels Apr 18, 2019
NavrotskyVasyl added a commit to NavrotskyVasyl/create-aio-app that referenced this issue Apr 20, 2019
Arfey pushed a commit that referenced this issue Apr 20, 2019
* Added name to contributors.

* Added help command.

* Added `help` command to readme. Close #93

* Rollback pip3 to pip.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Easy for first pull request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant