(docs_dir, jdk_path=None)
| 380 | raise Exception("Unable to parse Leiningen regexes from output:\n%s" % value) |
| 381 | |
| 382 | def write_docs(docs_dir, jdk_path=None): |
| 383 | temp_dir = tempfile.mkdtemp() |
| 384 | try: |
| 385 | invoke_lein(['with-profile', 'docs', 'run', '-m', 'editor.docs', temp_dir], jdk_path) |
| 386 | source = path.join(temp_dir, 'editor.apidoc') |
| 387 | target = path.join(docs_dir, 'editor.apidoc') |
| 388 | with open(source, 'rb') as f: |
| 389 | source_bytes = f.read() |
| 390 | target_bytes = None |
| 391 | if path.isfile(target): |
| 392 | with open(target, 'rb') as f: |
| 393 | target_bytes = f.read() |
| 394 | if source_bytes != target_bytes: |
| 395 | os.makedirs(docs_dir, exist_ok=True) |
| 396 | shutil.copyfile(source, target) |
| 397 | finally: |
| 398 | shutil.rmtree(temp_dir) |
| 399 | |
| 400 | def get_exe_suffix(platform): |
| 401 | return ".exe" if 'win32' in platform else "" |
no test coverage detected