#326 Add support of sudo with pipes

This commit is contained in:
nvbn
2015-08-11 01:15:05 +03:00
parent 41a0a766ce
commit b29113c229
2 changed files with 10 additions and 3 deletions
+4 -1
View File
@@ -28,4 +28,7 @@ def match(command, settings):
def get_new_command(command, settings):
return u'sudo {}'.format(command.script)
if '>' in command.script:
return u'sudo sh -c "{}"'.format(command.script.replace('"', '\\"'))
else:
return u'sudo {}'.format(command.script)