gstreamer: update translations
[platform/upstream/gstreamer.git] / ci / scripts / check-documentation-diff.py
1 #!/usr/bin/python3
2 import os, subprocess, sys
3
4 if __name__ == "__main__":
5     diffsdir = 'plugins-cache-diffs'
6     os.makedirs(diffsdir, exist_ok=True)
7     res = 0
8     try:
9         subprocess.check_call(['git', 'diff', '--quiet'] )
10     except subprocess.CalledProcessError:
11         diffname = os.path.join(diffsdir, 'plugins_cache.diff')
12         res += 1
13         with open(diffname, 'w') as diff:
14             subprocess.check_call(['git', 'diff'], stdout=diff)
15             print('\033[91mYou have a diff in the documentation cache. Please update with:\033[0m')
16             print('     $ curl %s/%s | git apply -' % (os.environ['CI_ARTIFACTS_URL'], diffname.replace('../', '')))
17
18     if res != 0:
19         print('(note that it might take a few minutes for artefacts to be available on the server)\n')
20         sys.exit(res)