From 198f9851a5f486c387aa3d715c03c4983fff29d0 Mon Sep 17 00:00:00 2001 From: Vikash Kothary Date: Sun, 16 Jan 2022 20:49:20 +0000 Subject: [PATCH] chore: Move command to run jupyter notebooks from Makefile to scripts --- Makefile | 4 ---- config/.env.example | 3 ++- scripts/jupyter.sh | 7 +++++++ 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 scripts/jupyter.sh diff --git a/Makefile b/Makefile index 57809b4..71bbbc2 100755 --- a/Makefile +++ b/Makefile @@ -33,10 +33,6 @@ run: init: @${POETRY} install -.PHONY: notebooks #: Run jupyter notebooks. -notebooks: - @${PYTHON} -m jupyter ${JUPYTER_OPTION} - %: @test -f scripts/${*}.sh @${SHELL} scripts/${*}.sh diff --git a/config/.env.example b/config/.env.example index 7ddc2a9..a9c8106 100644 --- a/config/.env.example +++ b/config/.env.example @@ -23,7 +23,8 @@ ANKISYNCD_SESSION_DB_PATH=./session.db MKDOCS_OPTION=serve ## Jupyter -JUPYTER_OPTION=lab +### JUPYTER_CMD +### JUPYTER_NOTEBOOK_DIR ## Path PATH:=.venv/bin:${PATH} \ No newline at end of file diff --git a/scripts/jupyter.sh b/scripts/jupyter.sh new file mode 100644 index 0000000..e3fd688 --- /dev/null +++ b/scripts/jupyter.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# file: jupyter.sh +# description: Run Jupyter Notebooks. + +[[ ! -z "${JUPYTER_CMD}" ]] || JUPYTER_CMD=lab +[[ ! -z "${JUPYTER_NOTEBOOK_DIR}" ]] || JUPYTER_NOTEBOOK_DIR=docs/src/notebooks +${JUPYTER} ${JUPYTER_CMD} --notebook-dir=${JUPYTER_NOTEBOOK_DIR} \ No newline at end of file