Skip to content
Closed
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 @@ -57,7 +57,12 @@ export async function resolveBasicEnv(env: BasicEnvInfo): Promise<PythonEnvInfo>
await updateEnvUsingRegistry(resolvedEnv);
}
setEnvDisplayString(resolvedEnv);
resolvedEnv.id = getEnvID(resolvedEnv.executable.filename, resolvedEnv.location);
let fileName = resolvedEnv.executable.filename;
if (env.envPath && env.kind === PythonEnvKind.Conda && path.basename(fileName) === fileName) {
fileName =
getOSType() === OSType.Windows ? path.join(env.envPath, fileName) : path.join(env.envPath, 'bin', fileName);
}
resolvedEnv.id = getEnvID(fileName, resolvedEnv.location);
Copy link
Author

Choose a reason for hiding this comment

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

I think this is a valid approach, because the new env will take the place of this old env.
& worst case scenario, the id will be different from the old env, which is already the case, hence no harm

const { ctime, mtime } = await getFileInfo(resolvedEnv.executable.filename);
resolvedEnv.executable.ctime = ctime;
resolvedEnv.executable.mtime = mtime;
Expand Down