blob: 634e14a54fad79e822c2deb59f8ff73cf40b6b9a [file] [log] [blame]
#!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
_DEVIL_PATH = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..'))
from devil.utils import cmd_helper
'devil/android/sdk/': 'docs/',
'devil/android/': 'docs/',
'devil/utils/': 'docs/',
_MARKDOWN_SCRIPT = os.path.join(_DEVIL_PATH, 'devil', 'utils', '')
def main():
failed = False
for k, v in _FILES_TO_DOC.iteritems():
module_path = os.path.join(_DEVIL_PATH, k)
module_link = _DEVIL_URL + k
doc_path = os.path.join(_DEVIL_PATH, v)
status, stdout = cmd_helper.GetCmdStatusAndOutput(
[sys.executable, _MARKDOWN_SCRIPT, module_path,
'--module-link', module_link])
if status:
logging.error('Failed to update doc for %s' % module_path)
failed = True
with open(doc_path, 'w') as doc_file:
return 1 if failed else 0
if __name__ == '__main__':