mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Shell: Make 'if' expressions return the unevaluated value of blocks
This makes it possible to actually put them in a sequence and cast them to commands.
This commit is contained in:
parent
50473003be
commit
5ec139e728
3 changed files with 14 additions and 4 deletions
|
@ -730,7 +730,12 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
|
|||
}
|
||||
}
|
||||
|
||||
if (command.argv.is_empty() && !command.next_chain.is_empty() && command.should_immediately_execute_next && command.next_chain.first().node->should_override_execution_in_current_process()) {
|
||||
if (command.argv.is_empty()
|
||||
&& !command.next_chain.is_empty()
|
||||
&& command.should_immediately_execute_next
|
||||
&& command.redirections.is_empty()
|
||||
&& command.next_chain.first().node->should_override_execution_in_current_process()) {
|
||||
|
||||
for (auto& next_in_chain : command.next_chain)
|
||||
run_tail(command, next_in_chain, last_return_code);
|
||||
return nullptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue