2 import os, subprocess, sys
4 if __name__ == "__main__":
5 diffsdir = 'plugins-cache-diffs'
6 os.makedirs(diffsdir, exist_ok=True)
9 subprocess.check_call(['git', 'diff', '--quiet'] )
10 except subprocess.CalledProcessError:
11 diffname = os.path.join(diffsdir, 'plugins_cache.diff')
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('../', '')))
19 print('(note that it might take a few minutes for artefacts to be available on the server)\n')