Skip to content

feat: add opam support#1298

Merged
zimbatm merged 1 commit intodirenv:masterfrom
smorimoto:add-opam-support
Jul 25, 2024
Merged

feat: add opam support#1298
zimbatm merged 1 commit intodirenv:masterfrom
smorimoto:add-opam-support

Conversation

@smorimoto
Copy link
Copy Markdown
Contributor

This PR adds support for opam.

@smorimoto
Copy link
Copy Markdown
Contributor Author

direnv is mentioned in the official OCaml documentation, so having a formal way for direnv to layout does not seem like a bad idea. I often have projects that use OCaml with Node.js, and I just wanted to use layout node and layout opam together, but in the long run it's pretty convenient to be able to maintain changes on the opam side in one place.

@zimbatm
Copy link
Copy Markdown
Member

zimbatm commented Jul 13, 2024

sounds good!

@smorimoto
Copy link
Copy Markdown
Contributor Author

Gentle ping

Signed-off-by: Sora Morimoto <sora@morimoto.io>
Co-authored-by: Jonas Chevalier <zimbatm@zimbatm.com>
@smorimoto
Copy link
Copy Markdown
Contributor Author

If opam switch is not initialized, this error will happen, but the OPAMSWITCH variable is exposed, so opam will definitely not point to any different switch and will not cause unexpected behavior.

❯ direnv allow

direnv: loading ~/src/github.com/kuis-isle3sw/IoPLMaterials/.envrc
[ERROR] The selected switch /Users/smorimoto/src/github.com/kuis-isle3sw/IoPLMaterials is not installed. Please fix the value of the OPAMSWITCH environment variable, or use the '--switch <name>' flag
direnv: export +OPAMSWITCH

@smorimoto
Copy link
Copy Markdown
Contributor Author

@zimbatm Ready to merge!

@zimbatm zimbatm merged commit 68978ef into direnv:master Jul 25, 2024
@smorimoto smorimoto deleted the add-opam-support branch July 25, 2024 08:19
@smorimoto
Copy link
Copy Markdown
Contributor Author

@zimbatm Thank you for your review and the effort you put into creating and maintaining this software!

@smorimoto
Copy link
Copy Markdown
Contributor Author

@zimbatm Could you create a new release for this PR?

@smorimoto
Copy link
Copy Markdown
Contributor Author

Gentle reminder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants