filter-repo: make --version more robust against modified shebangs

Signed-off-by: Elijah Newren <newren@gmail.com>
pull/101/head
Elijah Newren 4 years ago
parent e9c2d9adb5
commit 7c877cd750

@ -1609,7 +1609,7 @@ class GitUtils(object):
contents = f.read()
# If people replaced @@LOCALEDIR@@ string to point at their local
# directory, undo it so we can get original source version.
contents = re.sub(br'^#\!/usr/bin/env python.*',
contents = re.sub(br'\A#\!.*',
br'#!/usr/bin/env python3', contents)
contents = re.sub(br'(\("GIT_TEXTDOMAINDIR"\) or ").*"',
br'\1@@LOCALEDIR@@"', contents)

Loading…
Cancel
Save