2019-09-26 00:32:44 +00:00
|
|
|
""" Check that there are no database migration files which have not been committed. """
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import subprocess
|
|
|
|
|
2019-09-26 00:37:39 +00:00
|
|
|
print("Checking for uncommitted locale files...")
|
2019-09-26 00:32:44 +00:00
|
|
|
|
|
|
|
cmd = ['git', 'status']
|
|
|
|
|
|
|
|
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
|
|
|
|
|
|
out, err = proc.communicate()
|
|
|
|
|
|
|
|
locales = []
|
|
|
|
|
|
|
|
for line in str(out.decode()).split('\n'):
|
2019-09-26 00:37:39 +00:00
|
|
|
# Check for any compiled translation files that have not been committed
|
2019-09-27 00:12:46 +00:00
|
|
|
if 'modified:' in line and '/locale/' in line and 'django.po' in line:
|
2019-09-26 00:32:44 +00:00
|
|
|
locales.append(line)
|
|
|
|
|
|
|
|
if len(locales) > 0:
|
|
|
|
print("There are {n} unstaged locale files:".format(n=len(locales)))
|
|
|
|
|
2021-11-19 20:50:41 +00:00
|
|
|
for lang in locales:
|
|
|
|
print(" - {l}".format(l=lang))
|
2019-09-26 00:32:44 +00:00
|
|
|
|
2021-11-19 21:41:29 +00:00
|
|
|
sys.exit(len(locales))
|