Skip to content
Merged
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
12 changes: 6 additions & 6 deletions src/managers/conda/condaUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
import { getConfiguration } from '../../common/workspace.apis';
import { getGlobalPersistentState, getWorkspacePersistentState } from '../../common/persistentState';
import which from 'which';
import { shortVersion, sortEnvironments } from '../common/utils';
import { shortVersion, sortEnvironments, untildify } from '../common/utils';
import { pickProject } from '../../common/pickers/projects';
import { CondaStrings } from '../../common/localize';
import { showErrorMessage } from '../../common/errors/utils';
Expand Down Expand Up @@ -54,7 +54,8 @@ async function setConda(conda: string): Promise<void> {

export function getCondaPathSetting(): string | undefined {
const config = getConfiguration('python');
return config.get<string>('condaPath');
const value = config.get<string>('condaPath');
return (value && typeof value === 'string') ? untildify(value) : value;
}

export async function getCondaForWorkspace(fsPath: string): Promise<string | undefined> {
Expand Down Expand Up @@ -113,20 +114,19 @@ async function findConda(): Promise<readonly string[] | undefined> {
}

export async function getConda(): Promise<string> {
const config = getConfiguration('python');
const conda = config.get<string>('condaPath');
const conda = getCondaPathSetting();
if (conda) {
return conda;
Copy link
Member

Choose a reason for hiding this comment

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

This probably needs it too?

Copy link
Member

Choose a reason for hiding this comment

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

Ah! I see you have added it above, where the setting is read.

}

if (condaPath) {
return condaPath;
return untildify(condaPath);
}

const state = await getWorkspacePersistentState();
condaPath = await state.get<string>(CONDA_PATH_KEY);
if (condaPath) {
return condaPath;
return untildify(condaPath);
}

const paths = await findConda();
Expand Down
Loading