Add run and open commands to Makefile and refactor all commands

This commit is contained in:
Vikash Kothary 2021-02-07 16:19:53 +00:00
parent f9d5d93024
commit d39d2b253f
2 changed files with 17 additions and 10 deletions

View File

@ -15,20 +15,28 @@ help:
.PHONY: docs #: Build and serve documentation.
docs: print-env
@${MKDOCS} ${MKDOCS_OPTION} -f docs/mkdocs.yml
@${PYTHON} -m mkdocs ${MKDOCS_OPTION} -f docs/mkdocs.yml
.PHONY: tests #: Run unit tests.
tests:
@${UNITTEST} discover -s tests
@${PYTHON} -m unittest discover -s tests
.PHONY: notebooks #: Run jupyter notebooks.
notebooks:
@${JUPYTER} ${JUPYTER_OPTION}
.PHONY: run
run:
@${PYTHON} -m ankisyncd
%:
@test -f scripts/${*}.sh
@${SHELL} scripts/${*}.sh
@${BASH} scripts/${*}.sh
.PHONY: init #: Download Python dependencies.
init:
@${POETRY} install
@${POETRY} install
.PHONY: notebooks #: Run jupyter notebooks.
notebooks:
@${PYTHON} -m jupyter ${JUPYTER_OPTION}
.PHONY: open
open:
@${OPEN} http://127.0.0.1:27701

View File

@ -2,9 +2,8 @@
## Make
POETRY=poetry
MKDOCS=poetry run mkdocs
JUPYTER=poetry run jupyter
UNITTEST=poetry run python -m unittest
PYTHON=poetry run python
BASH=bash
## Ankisyncd
ANKISYNCD_HOST=0.0.0.0