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. .PHONY: docs #: Build and serve documentation.
docs: print-env docs: print-env
@${MKDOCS} ${MKDOCS_OPTION} -f docs/mkdocs.yml @${PYTHON} -m mkdocs ${MKDOCS_OPTION} -f docs/mkdocs.yml
.PHONY: tests #: Run unit tests. .PHONY: tests #: Run unit tests.
tests: tests:
@${UNITTEST} discover -s tests @${PYTHON} -m unittest discover -s tests
.PHONY: notebooks #: Run jupyter notebooks. .PHONY: run
notebooks: run:
@${JUPYTER} ${JUPYTER_OPTION} @${PYTHON} -m ankisyncd
%: %:
@test -f scripts/${*}.sh @test -f scripts/${*}.sh
@${SHELL} scripts/${*}.sh @${BASH} scripts/${*}.sh
.PHONY: init #: Download Python dependencies. .PHONY: init #: Download Python dependencies.
init: 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 ## Make
POETRY=poetry POETRY=poetry
MKDOCS=poetry run mkdocs PYTHON=poetry run python
JUPYTER=poetry run jupyter BASH=bash
UNITTEST=poetry run python -m unittest
## Ankisyncd ## Ankisyncd
ANKISYNCD_HOST=0.0.0.0 ANKISYNCD_HOST=0.0.0.0