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

[Feature Request] Add Use hooks for Plugins #56

Closed
bytemain opened this issue Feb 29, 2024 · 4 comments · Fixed by #58
Closed

[Feature Request] Add Use hooks for Plugins #56

bytemain opened this issue Feb 29, 2024 · 4 comments · Fixed by #58
Assignees
Labels
enhancement New feature or request

Comments

@bytemain
Copy link
Member

as we discussed in version-fox/version-fox-plugins#14

if we want to use vfox use nodejs@20, we want the plugin provide the local installed version that match 20.

for example:

function PLUGIN:PreUse(ctx) 
  local query = ctx.query
  local installed = ctx.installed
end
@aooohan aooohan added the enhancement New feature or request label Feb 29, 2024
@aooohan
Copy link
Member

aooohan commented Feb 29, 2024

This hook is also needed to solve the following issue:

@bytemain
Copy link
Member Author

Can you assign this to me? I can implement all the basic function and we can discuss what should be pass to the PreUse hooks and what it should return

@aooohan
Copy link
Member

aooohan commented Feb 29, 2024

Can you assign this to me? I can implement all the basic function and we can discuss what should be pass to the PreUse hooks and what it should return

Yes, why not. But it's not just a matter of implementing a PreUse hook, I have to think about the relationship between vfox use and vfox env.
vfox use just writes version info to .tool-versions, vfox env is where it really takes effect.

@bytemain
Copy link
Member Author

CleanShot 2024-02-29 at 17 37 00@2x

looks very good if PreUse return a valid version, we can keep the EnvKeys fucntion now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants