change: venv priority: specified > /Users/debugtalk/.hrp/venv

This commit is contained in:
debugtalk
2022-06-14 10:35:33 +08:00
parent 2bb7152643
commit d91eba501c
4 changed files with 10 additions and 10 deletions

View File

@@ -49,10 +49,7 @@ func initPlugin(path, venv string, logOn bool) (plugin funplugin.IPlugin, err er
}
pluginPath = genPyPluginPath
// priority: specified > projectDir/.venv > $HOME/.hrp/venv
if venv == "" && builtin.IsFolderPathExists(filepath.Join(filepath.Dir(pluginPath), ".venv")) {
venv = filepath.Join(filepath.Dir(pluginPath), ".venv")
}
// priority: specified > $HOME/.hrp/venv
err = builtin.PrepareVenv(venv)
if err != nil {
log.Error().Err(err).Msg("prepare python3 venv failed")