npm run format-check

This commit is contained in:
Aparna Jyothi 2025-02-07 18:05:59 +05:30
parent c002fb52fe
commit efb63d1885

View file

@ -138,30 +138,31 @@ export async function useCpythonVersion(
const version = path.basename(path.dirname(installDir)); const version = path.basename(path.dirname(installDir));
const major = semver.major(version); const major = semver.major(version);
const minor = semver.minor(version); const minor = semver.minor(version);
if (major >= 3 && (major > 3 || minor >= 10)) { if (major >= 3 && (major > 3 || minor >= 10)) {
const arch = architecture === 'x64' ? '64' : '32'; const arch = architecture === 'x64' ? '64' : '32';
const userScriptsDir = path.join( const userScriptsDir = path.join(
process.env['APPDATA'] || '', process.env['APPDATA'] || '',
'Python', 'Python',
`Python${major}${minor}-${arch}`, // Add architecture-specific folder (e.g., Python310-64 or Python310-32) `Python${major}${minor}-${arch}`, // Add architecture-specific folder (e.g., Python310-64 or Python310-32)
'Scripts' 'Scripts'
); );
// Add the dynamically constructed path to the environment PATH variable // Add the dynamically constructed path to the environment PATH variable
core.addPath(userScriptsDir); core.addPath(userScriptsDir);
core.debug(`Updated PATH with architecture-specific path: ${userScriptsDir}`); core.debug(
`Updated PATH with architecture-specific path: ${userScriptsDir}`
);
} else { } else {
// For Python < 3.10, add the default path without architecture-specific folder as per the official installer path // For Python < 3.10, add the default path without architecture-specific folder as per the official installer path
const userScriptsDir = path.join( const userScriptsDir = path.join(
process.env['APPDATA'] || '', process.env['APPDATA'] || '',
'Python', 'Python',
`Python${major}${minor}`, `Python${major}${minor}`,
'Scripts' 'Scripts'
); );
// Add the default path to the environment PATH variable // Add the default path to the environment PATH variable
core.addPath(userScriptsDir); core.addPath(userScriptsDir);
core.debug(`Updated PATH for Python < 3.10: ${userScriptsDir}`); core.debug(`Updated PATH for Python < 3.10: ${userScriptsDir}`);