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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(golang-rewrite): PluginAdd function #26

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Conversation

Stratus3D
Copy link
Member

This PR implements a PluginAdd function that will eventually be called by the asdf plugin add command, which hasn't been set up yet. A similar PluginAddFromRepo function will be created next to install plugins from the plugins repo. Both functions will be called from the asdf plugin add command code.

Changes in this PR:

  • Add go-git/v5 as a dependency for working with Git repos
  • Move config Golang code into new Golang package
  • Create some helper functions for working with asdf plugins
  • Create PluginAdd function
  • Write tests

As always, ALL feedback is welcome! I'm a complete novice at Golang trying my best to find the Golang way of doing things.

@@ -1,6 +1,5 @@
/installs
/downloads
/plugins
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This directory now contains the Golang plugin package.

github.com/mitchellh/go-homedir v1.1.0
github.com/sethvargo/go-envconfig v1.0.0
github.com/stretchr/testify v1.8.4
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been trying to avoid adding dependencies but I really like testify's simple API for assertions.

@Stratus3D Stratus3D force-pushed the tb/plugin-add-command branch 2 times, most recently from a8ce976 to c951220 Compare February 28, 2024 12:05
* Add go-git as a dependency
* Remove plugins dir from gitignore
* Move config code to config package
* Create validatePluginName function
* Create PluginDirectory function
* Create PluginExists function
* Implement PluginAdd function
* Add testify as a dependency
* Write test for PluginAdd happy path
@Stratus3D Stratus3D force-pushed the tb/plugin-add-command branch from c951220 to 752dd49 Compare February 28, 2024 12:22
@Stratus3D Stratus3D merged commit dc0e048 into master Feb 28, 2024
7 of 9 checks passed
@Stratus3D Stratus3D deleted the tb/plugin-add-command branch February 28, 2024 12:25
@Stratus3D
Copy link
Member Author

I've merged this PR so I can keep moving forward, but feedback is still welcome!

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.

1 participant