Commit 23053995 authored by Michal Čihař's avatar Michal Čihař

Implement calling pre commit hook (issue #221)

parent 12cf9260
......@@ -28,7 +28,7 @@ from django.core.exceptions import ValidationError
from django.core.cache import cache
from django.utils import timezone
from django.core.urlresolvers import reverse
import os.path
import os
import git
from translate.storage import poheader
from datetime import datetime, timedelta
......@@ -717,6 +717,16 @@ class Translation(models.Model, URLMixin):
# Format commit message
msg = self.get_commit_message()
# Pre commit hook
if self.subproject.pre_commit_script != '':
ret = os.system(self.subproject.pre_commit_script)
if ret != 0:
weblate.logger.error(
'Failed to run pre commit script (%d): %s',
ret,
self.subproject.pre_commit_script
)
# Create list of files to commit
files = [self.filename]
if self.subproject.extra_commit_file != '':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment