diff --git a/publish.py b/publish.py index a313221..d07be6d 100755 --- a/publish.py +++ b/publish.py @@ -167,8 +167,9 @@ def publish_sphinx(module): output_dir = os.path.join(web_directory, module.get('name')) build_dir = os.path.join(checkout_dir, '_build/html') cmd = '%s/venv/bin/sphinx-build -b html -d _build/doctrees . _build/html' % os.getcwd() - os.system('cd %s && %s' % (checkout_dir, cmd)) - shutil.rmtree(output_dir) + os.system('cd %s && %s >/dev/null 2>&1' % (checkout_dir, cmd)) + if os.path.isdir(output_dir): + shutil.rmtree(output_dir) shutil.copytree(build_dir, output_dir)