Fix bug in append() when sudo was involved (?)

This commit is contained in:
Lance Edgar 2019-09-12 22:05:47 -05:00
parent c0eed0e969
commit 7b939ec4a3

View file

@ -120,7 +120,7 @@ def append(c, filename, text, use_sudo=False, partial=False, escape=True,
shell=shell)):
continue
line = line.replace("'", r"'\\''") if escape else line
func("echo '%s' >> %s" % (line, _expand_path(c, filename)))
func("""bash -c "echo '%s' >> %s" """ % (line, _expand_path(c, filename)))
def _escape_for_regex(text):