We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
比如说我经常使用 nodejs,我敲命令时需要敲很长:
vfox use [email protected]
如果有环境变量,我就可以可以写一个 shell 函数,
function nvf() { VFOX_PLUGIN_NAME=nodejs vfox $* }
这样我就只需要用 nvf use xxx 即可
可以通过环境变量设置插件名,设置插件名后使用插件不需要加 @ 了
The text was updated successfully, but these errors were encountered:
@aooohan 看看我们需不需要实现这个功能,要的话我来做吧
Sorry, something went wrong.
如果我没理解错的话, 我们可以进一步优化: 假设新命令为short(后期再说).
vfox short nvf nodejs -> $VFOX_HOME下生成记录.
vfox short nvf nodejs
vfox activate -> 激活的时候, 顺便给他注入一个名字为nvf的函数. 里面就是你上面提到的写法.
vfox activate
打开shell之后, 就能直接使用nvf了.
nvf use xx nvf i xx
等等
这样就可以避免设置环境变量了. 是这个意思不?
是的,现在每次都要指定插件名,要写的很长
听起来还是可以先从环境变量入手,因为要用一个标志来标志当前要使用的插件
不需要, vfox short nvf nodejs就已经指定了函数和插件的映射关系, 这个关系存本地就行啦.
vfox里面现成的结构来处理这个逻辑, https://github.com/version-fox/vfox/blob/main/internal/env/record.go
但是可能需要你将他抽成公共的, 目前仅.tool-versions使用.
.tool-versions
bytemain
No branches or pull requests
1. Your usage scenarios?
比如说我经常使用 nodejs,我敲命令时需要敲很长:
如果有环境变量,我就可以可以写一个 shell 函数,
这样我就只需要用 nvf use xxx 即可
2. What is your expected outcome?
可以通过环境变量设置插件名,设置插件名后使用插件不需要加 @ 了
The text was updated successfully, but these errors were encountered: