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

Add [once] table option to xshe.toml #21

Open
superatomic opened this issue Apr 2, 2022 · 2 comments
Open

Add [once] table option to xshe.toml #21

superatomic opened this issue Apr 2, 2022 · 2 comments
Labels
enhancement New feature or request feature Added functionality

Comments

@superatomic
Copy link
Owner

superatomic commented Apr 2, 2022

The [once] table should be a table that only runs if it hasn't setup any of its environment variables yet. It will do this by adding a environment variable __xshe_NAME, where NAME is the name of each environment variable.

For example, to set PATH without having it keep being modified every time xshe.toml gets sourced, this can be done:

[once]
PATH = ["$BIN_HOME", "$CARGO_HOME/bin", "$PATH"]

This will set these two environment variables if there is not a environment variable named $__xshe_PATH set to 1: $PATH to the expected value, and $__xshe_PATH to 1.

Additionally, specific tables [shell.SHELL.once] (where SHELL is any of the supported shells) should be created that work like shell.SHELL but only run if the given shell is being used.

@superatomic superatomic added the enhancement New feature or request label Apr 2, 2022
@superatomic superatomic self-assigned this Apr 2, 2022
@superatomic superatomic modified the milestones: v0.5.0, v0.4.0 Apr 3, 2022
@superatomic
Copy link
Owner Author

With the changes in #30, the necessity for shell-specific [once] tables is no longer relevant.

@superatomic superatomic added feature Added functionality good first issue Good for newcomers labels Apr 10, 2022
@superatomic
Copy link
Owner Author

v0.4.0 is shaping up to be a big release already, so I'm going to remove this issue from the v0.4.0 milestone. This issue will probably be implemented in v0.5.0.

@superatomic superatomic removed this from the v0.4.0 milestone Apr 15, 2022
@superatomic superatomic removed the good first issue Good for newcomers label Apr 30, 2022
@superatomic superatomic removed their assignment May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature Added functionality
Projects
None yet
Development

No branches or pull requests

1 participant