Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/test/check_clean.py
4128 views
1
#!/usr/bin/env python3
2
# Copyright 2019 The Emscripten Authors. All rights reserved.
3
# Emscripten is available under two separate licenses, the MIT license and the
4
# University of Illinois/NCSA Open Source License. Both these licenses can be
5
# found in the LICENSE file.
6
7
"""Check for clean checkout. This is run after tests during CI to ensure
8
we are not polluting the source checkout.
9
"""
10
11
import os
12
import subprocess
13
import sys
14
15
16
def main():
17
print("Running 'git status --short'")
18
print('')
19
20
here = os.path.dirname(__file__)
21
root = os.path.dirname(here)
22
output = subprocess.check_output(['git', 'status', '--short'], cwd=root)
23
output = output.decode('utf-8').strip()
24
if not output:
25
print('Tree is clean.')
26
return 0
27
28
print(output)
29
print('\nCheckout is not clean. See above for list of dirty/untracked files.')
30
return 1
31
32
33
if __name__ == '__main__':
34
sys.exit(main())
35
36