mirror of
https://github.com/actions/setup-python.git
synced 2025-02-13 12:00:31 -05:00
npm run format-check
This commit is contained in:
parent
c002fb52fe
commit
efb63d1885
1 changed files with 8 additions and 7 deletions
|
@ -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}`);
|
||||||
|
|
Loading…
Add table
Reference in a new issue