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