-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
[BUG]: clink 最新版 vfox 切换失效 #408
Comments
经过测试是 v1.7.8 出现的问题,目前不确定是不是clink的问题,我先排查下,clink的源码不是很了解。 你可以先改成不使用协程的逻辑,我自己也是这样用的,我不在意启动快慢额。 os.setenv('__VFOX_PID', os.getpid())
local vfox_activate = io.popen('vfox activate clink')
for line in vfox_activate:lines() do
vfox_setenv(line)
end
vfox_activate:close()
os.execute('vfox env -c') |
我把它写在了clink_vfox.lua末尾的clink.promptcoroutine方法里面了,现在也能用着 |
@ViCrack 我找到了clink作者的一份示例 chrisant996/clink#282 (comment) ,启动创建的协程用了clink提供的方法。 然后我试了下面的脚本,在 clink 1.7.7 ~ clink 1.7.10 之间的这些版本都测试通过。请你验证一下额,没问题我再提PR额。 local vfox_task = coroutine.create(function()
os.setenv('__VFOX_PID', os.getpid())
os.setenv('__VFOX_CURTMPPATH', nil)
local vfox_activate = io.popen('vfox activate clink')
for line in vfox_activate:lines() do
vfox_setenv(line)
end
vfox_activate:close()
os.execute('vfox env -c')
end)
clink.runcoroutineuntilcomplete(vfox_task) 并且我用 os.clock() 测试上面协程执行时间,对比不用协程也快了很多倍,应该是生效了。 |
感谢,我已经验证,利用 |
Version
vfox version 0.6.0
OS
Windows
Describe the bug
clink升级到1.7.10.e3c993之后vfox无法切换sdk版本了,只能是全局模式
经过初步排查,可能是clink_vfox.lua文件中的vfox activate clink的没有执行结束的原因
vfox/internal/shell/clink_vfox.lua
Lines 137 to 150 in dad777b
执行 vfox u nodejs@16 提示这个
Warning: The current shell lacks hook support or configuration. It has switched to global scope automatically.
不知道其他人会不会也一样,可能是clink的bug?
The text was updated successfully, but these errors were encountered: