Skip to content

Commit

Permalink
Improve error message when less is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Oct 16, 2015
1 parent 79d7aac commit a596b87
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions doc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Build the documentation.

from __future__ import print_function
import os, shutil, tempfile
import errno, os, shutil, sys, tempfile
from subprocess import check_call, check_output, CalledProcessError, Popen, PIPE
from distutils.version import LooseVersion

Expand Down Expand Up @@ -76,10 +76,16 @@ def build_docs():
check_call(['sphinx-build', '-D',
'breathe_projects.format=' + os.path.join(os.getcwd(), 'doxyxml'),
'-b', 'html', doc_dir, 'html'])
check_call(['lessc', '--clean-css',
'--include-path=' + os.path.join(doc_dir, 'bootstrap'),
os.path.join(doc_dir, 'cppformat.less'),
'html/_static/cppformat.css'])
try:
check_call(['lessc', '--clean-css',
'--include-path=' + os.path.join(doc_dir, 'bootstrap'),
os.path.join(doc_dir, 'cppformat.less'),
'html/_static/cppformat.css'])
except OSError, e:
if e.errno != errno.ENOENT:
raise
print('lessc not found; make sure that Less (http://lesscss.org/) is installed')
sys.exit(1)
return 'html'

if __name__ == '__main__':
Expand Down

0 comments on commit a596b87

Please sign in to comment.