ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.24k stars 353 forks source link

Display an appropriate error message when the file given to opam init --config does not exist #5979

Open kit-ty-kate opened 4 months ago

kit-ty-kate commented 4 months ago

Fixes #5971

This PR introduces OpamUrl.kind which i think is an improvement over OpamUrl.local_{file,dir} as way of detecting if a url is local or not. Most functions that use OpamUrl.local_{file,dir} already check later if the file exist and fail gracefully so there is no need to check twice.

I opened https://github.com/ocaml/opam/issues/5978 to think about removing local_{file,dir} in the future, but for now this would be a fairly intrusive change.