tools.vpm: cleanup install part1 #19718
Merged
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.
Part1 of cleaning up the install procedure and making it more robust.
This PR changes consist of abstracting steps (used for both installations via a vpm shortcode and installations via a URL) into an
install_module
helper function. And simplifying by removing the need to usevpm_install
andvpm_install_
.馃 Generated by Copilot at 587f137
Refactored the
vpm_install
function incmd/tools/vpm/vpm.v
to improve code quality and support different module sources.馃 Generated by Copilot at 587f137
vpm_install_
function tovpm_install
to avoid confusion (link, link)vpm_install
function intovpm_install_from_vpm
andvpm_install_from_vcs
to make code more modular and readable (link, link)install_module
function to encapsulate logic of installing a module from a given VCS, URL, and path (link)os.execute
with calls toinstall_module
invpm_install_from_vpm
andvpm_install_from_vcs
to avoid code duplication and improve error handling (link, link)vpm_install_from_vcs
to take aSource
enum instead of a string as thevcs_key
argument and convert it to a string inside the function (link)vpm_install
withSource.vpm
tovpm_install_from_vpm
incmd/tools/vpm.v
(link)