Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools.vpm: cleanup install part1 #19718

Merged
merged 2 commits into from Nov 1, 2023
Merged

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Oct 31, 2023

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 use vpm_install and vpm_install_.

馃 Generated by Copilot at 587f137

Refactored the vpm_install function in cmd/tools/vpm/vpm.v to improve code quality and support different module sources.

馃 Generated by Copilot at 587f137

  • Rename vpm_install_ function to vpm_install to avoid confusion (link, link)
  • Split vpm_install function into vpm_install_from_vpm and vpm_install_from_vcs to make code more modular and readable (link, link)
  • Add install_module function to encapsulate logic of installing a module from a given VCS, URL, and path (link)
  • Replace calls to os.execute with calls to install_module in vpm_install_from_vpm and vpm_install_from_vcs to avoid code duplication and improve error handling (link, link)
  • Modify vpm_install_from_vcs to take a Source enum instead of a string as the vcs_key argument and convert it to a string inside the function (link)
  • Remove redundant or outdated comment line (link)
  • Remove empty line for formatting (link)
  • Update call to vpm_install with Source.vpm to vpm_install_from_vpm in cmd/tools/vpm.v (link)

@ttytm ttytm force-pushed the vpm/install-cleanup-p1 branch 3 times, most recently from 464747e to ebe0da4 Compare October 31, 2023 16:24
@spytheman spytheman merged commit be487b3 into vlang:master Nov 1, 2023
41 checks passed
@ttytm ttytm deleted the vpm/install-cleanup-p1 branch November 1, 2023 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants