vpm: minor cleanup and refactor of install funcs #19656
Closed
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.
I'm about to submit version-installs to allow to fix installations via vpm and dependencies to a tag. E.g.:
v install https://github.com/vlang/vsl@v0.1.50
/v install vsl@0.1.50
. Also some other fixes.Some things could be cleaned up and solved more optimally in the current code. They are submitted separately before, as I think it would get a bit messy if they are mixed with other changes.
🤖 Generated by Copilot at 5ba25f3
Refactor and simplify
vpm.v
to support different vcs for installing modules. Extract a commoninstall_module_from_vcs
function and use a switch statement to handle different vcs types.🤖 Generated by Copilot at 5ba25f3
install_module
function to avoid duplication and improve readability and maintainability (link, link, link)vpm_install
function to handle any supported vcs as the source argument (link, link)vpm_once_filter
andvcs_used_in_dir
functions by using built-infilter
method on arrays (link, link)vcs_key
parameter tovcs
invpm_install_from_vcs
function for consistency and clarity (link)vpm_install_from_vpm
function (link)vcs
variable invcs_used_in_dir
function (link, link)