MCPcopy Create free account
hub / github.com/defold/defold / write_docs

Function write_docs

editor/scripts/bundle.py:382–398  ·  view source on GitHub ↗
(docs_dir, jdk_path=None)

Source from the content-addressed store, hash-verified

380 raise Exception("Unable to parse Leiningen regexes from output:\n%s" % value)
381
382def 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
400def get_exe_suffix(platform):
401 return ".exe" if 'win32' in platform else ""

Callers 2

run_testsFunction · 0.85
bundle.pyFile · 0.85

Calls 2

invoke_leinFunction · 0.85
readMethod · 0.45

Tested by

no test coverage detected