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

feat: add env syncing support for nushell #1985

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

YummyOreo
Copy link
Contributor

Adds support for env syncing for nushell, it auto updates because it just parses autin dotfiles var list at runtime.

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

// nushell and load the env vars that way

String::from(
r#"atuin dotfiles var list | lines | parse "export {name}={value}" | reduce -f {} {|it, acc| $acc | upsert $it.name $it.value} | load-env"#,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does nushell have the same shellvar/env var difference?

atuin dotfiles var list will output

foo=bar

for a shellvar, and

export foo=var

for an env var

We'd probably want to handle both cases

Copy link
Contributor Author

@YummyOreo YummyOreo Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only way I've found to do local variables would be to update the plugin file after it runs and waits till the user opens a new shell. That would fix the updating problem and alias problems.

I can start work on this if it is desired.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes the most sense, in lieu of being able to load anything dynamically!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants