Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,10 @@ function getCustomVirtualEnvDirs(): string[] {
const venvFolders = getPythonSettingAndUntildify<string[]>(VENVFOLDERS_SETTING_KEY) ?? [];
const homeDir = getUserHomeDir();
if (homeDir) {
venvFolders.map((item) => path.join(homeDir, item)).forEach((d) => venvDirs.push(d));
venvFolders
.map((item) => (item.startsWith(homeDir) ? item : path.join(homeDir, item)))
Copy link
Author

Choose a reason for hiding this comment

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

If the path was already rooted with home dir, we'd still prefix with home dir

.forEach((d) => venvDirs.push(d));
venvFolders.forEach((item) => venvDirs.push(untildify(item)));
}
return Array.from(new Set(venvDirs));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ async function getCustomVirtualEnvDirs(): Promise<string[]> {
const venvFolders = getPythonSetting<string[]>(VENVFOLDERS_SETTING_KEY) ?? [];
const homeDir = getUserHomeDir();
if (homeDir && (await pathExists(homeDir))) {
venvFolders.map((item) => path.join(homeDir, item)).forEach((d) => venvDirs.push(d));
venvFolders
.map((item) => (item.startsWith(homeDir) ? item : path.join(homeDir, item)))
.forEach((d) => venvDirs.push(d));
venvFolders.forEach((item) => venvDirs.push(untildify(item)));
}
return asyncFilter(uniq(venvDirs), pathExists);
}
Expand Down
Loading