forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_emcc_help_text.py
More file actions
executable file
·37 lines (26 loc) · 1.09 KB
/
check_emcc_help_text.py
File metadata and controls
executable file
·37 lines (26 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python3
# Copyright 2020 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""Verifies that 'docs/emcc.txt' is in sync with sphinx output."""
import os
import subprocess
import sys
from pathlib import Path
root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def main():
build_output = os.path.join(root, 'site', 'build', 'text', 'docs', 'tools_reference', 'emcc.txt')
docs_file = os.path.join(root, 'docs', 'emcc.txt')
if not os.path.exists(build_output):
print('doc build output not found: %s' % build_output)
return 1
emcc_docs_output = Path(build_output).read_text()
emcc_docs = Path(docs_file).read_text()
if emcc_docs_output != emcc_docs:
print('contents of checked in docs/emcc.txt does not match build output:')
subprocess.call(['diff', '-u', build_output, docs_file])
return 1
print('docs look good')
if __name__ == '__main__':
sys.exit(main())