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

Use 0.85 syntax in direnv module #615

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

marcelarie
Copy link
Contributor

@marcelarie marcelarie commented Sep 21, 2023

To fix this error:

**  × Input type not supported.
    ╭─[/Users/m.manzanares/.config/nushell/config.nu:18:1]
 18 │       let direnv = (direnv export json | from json)
 19 │       let direnv = if ($direnv | length) == 1 { $direnv } else { {} }
    ·                        ───┬───   ───┬──
    ·                           │         ╰── only list, and table input data is supported
    ·                           ╰── input type: record
 20 │       $direnv | load-env
    ╰────**

@fdncred
Copy link
Collaborator

fdncred commented Sep 21, 2023

You could also do $direnv | values | length but I think is-empty works ok too.

@fdncred fdncred merged commit d459a7d into nushell:main Sep 21, 2023
@marcelarie marcelarie deleted the use-new-syntax-in-direnv branch September 21, 2023 16:12
@happysalada
Copy link

does anyone know how this script is supposed to run actually ?
it seems to work, but I'm not sure why or how.
direnv export json never seems to return anything
and also the $direnv variable can be empty or not depending at what times you run it.

@dywedir
Copy link

dywedir commented Sep 24, 2023

@happysalada direnv export doesn't show anything when all exported variables are already captured and made available to the current shell. So maybe this is your case?

@happysalada
Copy link

Alright but my problem is that direnv is always of length one, whether its empty or not. It makes me wonder what the original intent of the code was

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.

None yet

4 participants