mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-09 03:51:20 -03:00
littlecheck: Update to shell-quote replacements
Commit bb07435e3e4cbd34fcb667ec927353d176a0b2e8
This commit is contained in:
@@ -367,7 +367,10 @@ def perform_substitution(input_str, subs):
|
||||
text = m.group(1)
|
||||
for key, replacement in subs_ordered:
|
||||
if text.startswith(key):
|
||||
return replacement + text[len(key) :]
|
||||
# shell-quote the replacement, so it's usable in #RUN lines.
|
||||
# We could loosen this and only do it for #RUN/#REQUIRES,
|
||||
# but so far we don't need it anywhere.
|
||||
return shlex.quote(replacement + text[len(key) :])
|
||||
# No substitution found, so we default to running it as-is,
|
||||
# which will end up running it via $PATH.
|
||||
return text
|
||||
@@ -475,7 +478,7 @@ class TestRun(object):
|
||||
"""Decode a string and split it by newlines only,
|
||||
retaining the newlines.
|
||||
"""
|
||||
return [s + "\n" for s in s.decode("utf-8").split("\n")]
|
||||
return [s + "\n" for s in s.decode("utf-8", errors="backslashreplace").split("\n")]
|
||||
|
||||
if self.config.verbose:
|
||||
print(self.subbed_command)
|
||||
|
||||
Reference in New Issue
Block a user