fix: let the system figure out the elixir version for the project #162
+18
−107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an alternative to #93 that should fix the issue for any version manager, if any
Previously we were trying to identify the version manager used by the user(asdf or mise/rtx in particular) and try to get them to provide an environment we could use to get the elixir+erlang versions for the project
The issue we're facing is that we can't reliably find an environment that way, so we end up with PATHs that don't include elixir, include the wrong version, or include only
elixir
and noterl
.Similarly for mise, we had issues where the env parsing stopped working(compared to lexical, from which this code is based on).
This PR uses the approach used by Radon IDE: launch an interactive shell on the project path so the OS populates the PATH, grab that PATH and use it to then find
elixir
By doing this it doesn't matter which version manager you use or by what means elixir is installed, we can reliably get the same version the project expects.