feat(execution): set $? var

This commit is contained in:
william.valenduc 2026-01-22 13:10:23 +00:00
parent f20a02ddab
commit 6dd19a75ad
6 changed files with 42 additions and 5 deletions

View file

@ -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);