Skip to content
Snippets Groups Projects
Commit cbf2347e authored by stratact's avatar stratact Committed by Michael Aaron Murphy
Browse files

Use `shell.variables.set_var()` for setting the exit status in other areas

parent e656f1ab
No related branches found
No related tags found
No related merge requests found
......@@ -433,9 +433,11 @@ impl FlowLogic for Shell {
Statement::Error(number) => self.previous_status = number,
Statement::Let(action) => {
self.previous_status = self.local(action);
self.variables.set_var("?", &self.previous_status.to_string());
}
Statement::Export(action) => {
self.previous_status = self.export(action);
self.variables.set_var("?", &self.previous_status.to_string());
}
Statement::While {
expression,
......@@ -839,9 +841,11 @@ impl FlowLogic for Shell {
Statement::Error(number) => shell.previous_status = number,
Statement::Let(action) => {
shell.previous_status = shell.local(action);
shell.variables.set_var("?", &shell.previous_status.to_string());
}
Statement::Export(action) => {
shell.previous_status = shell.export(action);
shell.variables.set_var("?", &shell.previous_status.to_string());
}
Statement::While {
expression,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment