Add exit status codes to puter.exit()
, and an exit
builtin to Phoenix
#421
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
puter.exit()
now takes a status code, similar to the exit status on desktop OSes. This is passed to the appClosed event, so that eg a parent app can know whether its child app ran successfully.I've limited the exit status to being a number. We could probably expand that later, but I feel slightly paranoid about someone using it for exploits somehow.
For now, Phoenix prints to stdout when a process exits with a non-zero status code. This is because we lack other ways of displaying or querying that status code.
This also lets us have an
exit [CODE]
shell builtin, finally. It's a little hacky but it works.