feat(execution): set $? var
This commit is contained in:
parent
f20a02ddab
commit
6dd19a75ad
6 changed files with 42 additions and 5 deletions
10
src/main.c
10
src/main.c
|
|
@ -84,10 +84,14 @@ int main(int argc, char **argv)
|
|||
// Main parse-execute loop
|
||||
while (command_ast != NULL && command_ast->type != AST_END)
|
||||
{
|
||||
// Execute AST
|
||||
return_code = execution(command_ast, vars);
|
||||
if (command_ast->type != AST_VOID)
|
||||
{
|
||||
// Execute AST
|
||||
return_code = execution(command_ast, vars);
|
||||
|
||||
// set $? variable
|
||||
// set $? variable
|
||||
set_var_int(vars, "?", return_code);
|
||||
}
|
||||
|
||||
ast_free(&command_ast);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue