Skip to content

Commit

Permalink
125-jsdoc-windows
Browse files Browse the repository at this point in the history
Issue readthedocs#125.
jsdoc on windows is deployed as jsdoc.cmd
  • Loading branch information
fredbi committed Nov 12, 2017
1 parent cf226d4 commit 442cf84
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autoapi/mappers/javascript.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ def read_file(self, path, **kwargs):
'''
# TODO support JSON here
# TODO sphinx way of reporting errors in logs?

subcmd = 'jsdoc'
if os.name == 'nt':
subcmd='.'.join([subcmd,'cmd'])
try:
parsed_data = json.loads(subprocess.check_output(['jsdoc', '-X', path]))
parsed_data = json.loads(subprocess.check_output([subcmd, '-X', path]))
return parsed_data
except IOError:
self.app.warn('Error reading file: {0}'.format(path))
Expand Down

0 comments on commit 442cf84

Please sign in to comment.