Skip to content

Commit

Permalink
Merge pull request #23 from whisk-ml/setup-no-notebook-fix
Browse files Browse the repository at this point in the history
Don't set nb env if nb doesn't exist.
  • Loading branch information
itsderek23 committed May 17, 2020
2 parents db67fa7 + 53fd756 commit e42070c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions whisk/cli/commands/project/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import whisk.git as git
import os
import subprocess
from pathlib import Path

NOTEBOOK_EXAMPLE_PATH = "notebooks/getting_started.ipynb"

Expand Down Expand Up @@ -42,6 +43,10 @@ def exec_setup(nbenv):
exec("Making initial Git commit", "git commit -m 'Initial project structure' --author=\"Whisk <whisk@whisk-ml.org>\" > /dev/null")

def set_example_notebook_kernel(nbenv):
nb_file = Path(NOTEBOOK_EXAMPLE_PATH)
if not nb_file.is_file():
print("Getting started notebook does not exist @ {}. Not applying venv.".format(nb_file))
return
# Read in the file
with open(NOTEBOOK_EXAMPLE_PATH, 'r') as file :
filedata = file.read()
Expand Down

0 comments on commit e42070c

Please sign in to comment.