Skip to content

Commit

Permalink
Fix build command's exit code (#85)
Browse files Browse the repository at this point in the history
I.e. don't appear to succeed when actually failing.
  • Loading branch information
ceball authored Oct 11, 2018
1 parent 3145719 commit 6fb7b16
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
8 changes: 4 additions & 4 deletions nbsite/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import glob
import re
import sys
import subprocess
from os.path import dirname
from collections import ChainMap

Expand All @@ -25,14 +26,13 @@ def init(project_root='',doc='doc'):
# maybe add task dependencies

def fix_links(output):
# TODO: temp hack
os.system("nbsite_fix_links.py %s"%output)
subprocess.check_call(["nbsite_fix_links.py",output])


def build(what,output,project_root='',doc='doc',examples='examples',examples_assets="assets"):
# TODO: also have an overwrite flag
paths = _prepare_paths(project_root,examples=examples,doc=doc,examples_assets=examples_assets)
# TODO: temp hack
os.system('sphinx-build -b %s %s %s'%(what,paths['doc'],output))
subprocess.check_call(["sphinx-build","-b",what,paths['doc'],output])
if 'examples_assets' in paths:
build_assets = os.path.join(output,examples_assets)
print("Copying examples assets from %s to %s"%(paths['examples_assets'],build_assets))
Expand Down
14 changes: 0 additions & 14 deletions nbsite/nbbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,6 @@ def kc(self,v):
if self._ipython_startup is not None:
msg_id = self._kc.execute( # noqa: a mess
self._ipython_startup,silent=False,store_history=False,allow_stdin=False,stop_on_error=True)
# you can attempt to debug your startup code with this hack...
# exec_reply = self._wait_for_reply(msg_id, self._ipython_startup)
# while True:
# msg = self.kc.iopub_channel.get_msg()
# if msg['parent_header'].get('msg_id') != msg_id:
# continue
# else:
# try:
# output = output_from_msg(msg)
# except:
# continue
# if output.output_type == 'error':
# raise ValueError("Startup code failed: %s %s\n%s"%(output.ename,output.evalue,output.traceback))
# break


try:
Expand Down

0 comments on commit 6fb7b16

Please sign in to comment.