forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_emcc_help_text.py
executable file
·39 lines (27 loc) · 1.1 KB
/
check_emcc_help_text.py
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
38
39
#!/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
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
with open(build_output, 'r') as f:
emcc_docs_output = f.read()
with open(docs_file, 'r') as f:
emcc_docs = f.read()
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())