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

Nushell support #6330

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

benjamin-voisin
Copy link

This change make the command opam env work within nushell by typing

load-env (opam env | from json)

It does not add full nushell support, only for the env command, but it’s the first step. I don’t know that much about the code of opam and could not figure out where to make the other changes neccessary / when they are called, so this is open to improvments.

NOTE: nushell still has some breaking changes sometimes, so I don’t know how this will hold up to the future, but I am certain that it will be easier to change an existing implementation.

@rjbou rjbou self-requested a review December 16, 2024 13:16
@rjbou
Copy link
Collaborator

rjbou commented Dec 16, 2024

Thanks for the PR!

This change make the command opam env work within nushell by typing

load-env (opam env | from json)

If you don't want to add full support, just need a json output to be able to populate nushell environment, you can take a look to this comment, we have in mind to have something similar for CIs.

It does not add full nushell support, only for the env command, but it’s the first step. I don’t know that much about the code of opam and could not figure out where to make the other changes neccessary / when they are called, so this is open to improvments.

The other places where a change is needed are for generating the init scripts. they are generated at opam init stage, in order to have some automatic loading in *rc file (completion, environment handling, automatic environment update, etc.).
You can find examples here in the init scripts test.

NOTE: nushell still has some breaking changes sometimes, so I don’t know how this will hold up to the future, but I am certain that it will be easier to change an existing implementation.

If nushell users are willing to tell us when there is some update to do, and what are they, this is ok. It is hard for us to maintain a shell we don't use :).
Note that, ftm, opam has a release cycle of ~6 months. So breakages fix won't be immediately available.

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