Skip to content

Change direnv example to upload $env.PATH as a list #1058

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

Merged
merged 4 commits into from
Sep 15, 2023

Conversation

Gryff
Copy link
Contributor

@Gryff Gryff commented Sep 14, 2023

First of all thanks for the direnv example!
It got me unblocked, but I missed that I couldn't see the path in the list format when I typed $env.PATH.

I'm new to nushell, so if there's a better way to do this than the no_changes changes thing, let me know and I'll change it. I couldn't find like a $my_thing | is-not-empty.

@fdncred
Copy link
Contributor

fdncred commented Sep 15, 2023

I personally don't like things like upsert PATH {|it| $it.PATH | split row ":" }. To me, it's not useful to name the closure variable with a generic variable that means nothing. I prefer my variables to have meaning like upsert PATH {|direnv_result| $direnv_result.PATH | split row ":" }.

If we're just going for brevity, then you could do upsert PATH { $in.PATH | split row : }.

But let's land this anyway. Thanks.

@fdncred fdncred merged commit e52c618 into nushell:main Sep 15, 2023
@Gryff Gryff deleted the patch-1 branch September 15, 2023 12:33
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.

3 participants