build: chdir back to working directory after makemessages error (#77628)
gitea/publik-django-templatetags/pipeline/head There was a failure building this commit
Details
gitea/publik-django-templatetags/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
a9d0b2f3f0
commit
b458b1ceb1
10
setup.py
10
setup.py
|
@ -58,18 +58,19 @@ class make_translations(Command):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
curdir = os.getcwd()
|
||||||
try:
|
try:
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
|
|
||||||
for path, dirs, files in os.walk('publik_django_templatetags'):
|
for path, dirs, files in os.walk('publik_django_templatetags'):
|
||||||
if 'locale' not in dirs:
|
if 'locale' not in dirs:
|
||||||
continue
|
continue
|
||||||
curdir = os.getcwd()
|
|
||||||
os.chdir(os.path.realpath(path))
|
os.chdir(os.path.realpath(path))
|
||||||
call_command('makemessages', '-l', 'fr', '--add-location', 'file', '--no-obsolete')
|
call_command('makemessages', '-l', 'fr', '--add-location', 'file', '--no-obsolete')
|
||||||
os.chdir(curdir)
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
sys.stderr.write('!!! Please install Django >= 2.2 to make translations\n')
|
sys.stderr.write('!!! Please install Django >= 2.2 to make translations\n')
|
||||||
|
finally:
|
||||||
|
os.chdir(curdir)
|
||||||
|
|
||||||
|
|
||||||
class compile_translations(Command):
|
class compile_translations(Command):
|
||||||
|
@ -83,18 +84,19 @@ class compile_translations(Command):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
curdir = os.getcwd()
|
||||||
try:
|
try:
|
||||||
from django.core.management import call_command
|
from django.core.management import call_command
|
||||||
|
|
||||||
for path, dirs, files in os.walk('publik_django_templatetags'):
|
for path, dirs, files in os.walk('publik_django_templatetags'):
|
||||||
if 'locale' not in dirs:
|
if 'locale' not in dirs:
|
||||||
continue
|
continue
|
||||||
curdir = os.getcwd()
|
|
||||||
os.chdir(os.path.realpath(path))
|
os.chdir(os.path.realpath(path))
|
||||||
call_command('compilemessages')
|
call_command('compilemessages')
|
||||||
os.chdir(curdir)
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
sys.stderr.write('!!! Please install Django >= 2.2 to build translations\n')
|
sys.stderr.write('!!! Please install Django >= 2.2 to build translations\n')
|
||||||
|
finally:
|
||||||
|
os.chdir(curdir)
|
||||||
|
|
||||||
|
|
||||||
class build(_build):
|
class build(_build):
|
||||||
|
|
Loading…
Reference in New Issue