Skip to content

Commit

Permalink
cmd.py - Changed 'escape_string' to escape a package request with 's …
Browse files Browse the repository at this point in the history
…if '|' exists in the request
  • Loading branch information
ColinKennedy committed Feb 26, 2019
1 parent b3a2f78 commit f0e0556
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/rezplugins/shell/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,19 @@ def escape_string(self, value):
"""
if isinstance(value, EscapedString):
return value.formatted(self._escaper)
add_quotes = False
for _, txt in value.strings:
if '|' in txt:
add_quotes = True
break

result = value.formatted(self._escaper)

if add_quotes:
return '"{result}"'.format(result=result)

return result

return self._escaper(value)

def _saferefenv(self, key):
Expand Down

0 comments on commit f0e0556

Please sign in to comment.