mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-24 15:50:54 +00:00
.github
InvenTree
ci
check_api_endpoint.py
check_js_templates.py
check_locale_files.py
check_migration_files.py
check_version_number.py
deploy
docker
images
.eslintrc.yml
.gitattributes
.gitignore
.gitpod.yml
CONTRIBUTING.md
LICENSE
README.md
RELEASE.md
crowdin.yml
package.json
requirements.txt
setup.cfg
tasks.py
31 lines
790 B
Python
31 lines
790 B
Python
""" Check that there are no database migration files which have not been committed. """
|
|
|
|
# -*- coding: utf-8 -*-
|
|
from __future__ import unicode_literals
|
|
|
|
import sys
|
|
import subprocess
|
|
|
|
print("Checking for uncommitted locale files...")
|
|
|
|
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'):
|
|
# Check for any compiled translation files that have not been committed
|
|
if 'modified:' in line and '/locale/' in line and 'django.po' in line:
|
|
locales.append(line)
|
|
|
|
if len(locales) > 0:
|
|
print("There are {n} unstaged locale files:".format(n=len(locales)))
|
|
|
|
for lang in locales:
|
|
print(" - {l}".format(l=lang))
|
|
|
|
sys.exit(len(locales))
|