mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 10:05:39 +00:00
Check for altered translation files that have not been compiled
This commit is contained in:
29
ci/check_locale_files.py
Normal file
29
ci/check_locale_files.py
Normal file
@ -0,0 +1,29 @@
|
||||
""" 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 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'):
|
||||
if 'modified:' in line and '/locale/' in line:
|
||||
locales.append(line)
|
||||
|
||||
if len(locales) > 0:
|
||||
print("There are {n} unstaged locale files:".format(n=len(locales)))
|
||||
|
||||
for l in locales:
|
||||
print(" - {l}".format(l=l))
|
||||
|
||||
sys.exit(len(locales))
|
Reference in New Issue
Block a user