Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support environment variables that persist beyond single commands #10

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

ianthomas23
Copy link
Member

This PR adds a new Environment class that is a collection of environment variables that are owned by the Shell. These are copied into an individual WASM command's environment before the command is run, and changes are copied back out again afterwards. The copying in occurs in the preRun callback of the WASM module's constructor, which is a better place for the file system setting up so that is moved there as well.

Persistent environment variables are also required for builtin commands. A good example (the only builtin command so far) is cd which stores the current working directory in the PWD envvar and this is explicitly tested in a new test.

@ianthomas23 ianthomas23 added the enhancement New feature or request label Jul 8, 2024
@ianthomas23 ianthomas23 merged commit 3c0398f into main Jul 9, 2024
3 checks passed
@ianthomas23 ianthomas23 deleted the env_vars branch July 9, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant