[set_text_avriables][Windows][Fixed] Git command replacement

- Python implementation used by KiCad uses \ in the file names, which
  IMHO is wrong, they should learn from DJGPP tools, even DOS can
  handle /
- So we can't use filenames in re.sub without first escaping all \
Related to #325
This commit is contained in:
Salvador E. Tropea 2022-12-01 07:14:50 -03:00
parent 24a4a08858
commit fdd38d176a
1 changed files with 1 additions and 1 deletions

View File

@ -121,7 +121,7 @@ class Set_Text_Variables(BasePreFlight): # noqa: F821
command = r.command
if re_git.search(command):
git_command = self.ensure_tool('git')
command = re_git.sub(r'\1'+git_command+' ', command)
command = re_git.sub(r'\1'+git_command.replace('\\', r'\\')+' ', command)
cmd = ['/bin/bash', '-c', command]
result = run(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True)
if result.returncode: