From d39d2b253f82d51b6c195521783d928325ca6ee7 Mon Sep 17 00:00:00 2001 From: Vikash Kothary Date: Sun, 7 Feb 2021 16:19:53 +0000 Subject: [PATCH] Add run and open commands to Makefile and refactor all commands --- Makefile | 22 +++++++++++++++------- config/.env.example | 5 ++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 80d063e..475ea62 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file + @${POETRY} install + +.PHONY: notebooks #: Run jupyter notebooks. +notebooks: + @${PYTHON} -m jupyter ${JUPYTER_OPTION} + +.PHONY: open +open: + @${OPEN} http://127.0.0.1:27701 \ No newline at end of file diff --git a/config/.env.example b/config/.env.example index 35de7e1..7ddc2a9 100644 --- a/config/.env.example +++ b/config/.env.example @@ -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