Fix overridden PATH test, by ensuring bash command substitution rules

This commit is contained in:
Joe Rickerby
2020-06-28 21:51:06 +01:00
parent 27d97daf13
commit e31c24d3bb
+3 -1
View File
@@ -41,7 +41,9 @@ def evaluate_node(node: bashlex.ast.node, context: NodeExecutionContext) -> str:
if node.kind == 'word':
return evaluate_word_node(node, context=context)
elif node.kind == 'commandsubstitution':
return evaluate_command_node(node.command, context=context)
node_result = evaluate_command_node(node.command, context=context)
# bash removes training newlines in command substitution
return node_result.rstrip()
elif node.kind == 'parameter':
return evaluate_parameter_node(node, context=context)
else: