mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 04:58:57 +00:00
littlecheck: Update to shell-quote replacements
Commit bb07435e3e4cbd34fcb667ec927353d176a0b2e8
This commit is contained in:
parent
cb3d004a5a
commit
17d57b70d0
1 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue