mirror of
https://github.com/actions/setup-python.git
synced 2025-04-24 07:22:14 +00:00
Clean up and format
This commit is contained in:
parent
08f6b9181b
commit
3d8a1eb795
1 changed files with 10 additions and 14 deletions
|
@ -149,7 +149,9 @@ async function createGraalPySymlink(
|
||||||
}
|
}
|
||||||
|
|
||||||
async function installPip(pythonLocation: string) {
|
async function installPip(pythonLocation: string) {
|
||||||
core.info("Installing pip (GraalPy doesn't update pip because it uses a patched version of pip)");
|
core.info(
|
||||||
|
"Installing pip (GraalPy doesn't update pip because it uses a patched version of pip)"
|
||||||
|
);
|
||||||
const pythonBinary = path.join(pythonLocation, 'python');
|
const pythonBinary = path.join(pythonLocation, 'python');
|
||||||
await exec.exec(`${pythonBinary} -m ensurepip --default-pip`);
|
await exec.exec(`${pythonBinary} -m ensurepip --default-pip`);
|
||||||
}
|
}
|
||||||
|
@ -188,18 +190,12 @@ export function findRelease(
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sortedReleases = filterReleases.sort((previous, current) => {
|
const sortedReleases = filterReleases.sort((previous, current) =>
|
||||||
return (
|
semver.compare(
|
||||||
semver.compare(
|
semver.coerce(graalPyTagToVersion(current.tag_name))!,
|
||||||
semver.coerce(graalPyTagToVersion(current.tag_name))!,
|
semver.coerce(graalPyTagToVersion(previous.tag_name))!
|
||||||
semver.coerce(graalPyTagToVersion(previous.tag_name))!
|
)
|
||||||
) ||
|
);
|
||||||
semver.compare(
|
|
||||||
semver.coerce(graalPyTagToVersion(current.tag_name))!,
|
|
||||||
semver.coerce(graalPyTagToVersion(previous.tag_name))!
|
|
||||||
)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
const foundRelease = sortedReleases[0];
|
const foundRelease = sortedReleases[0];
|
||||||
const foundAsset = findAsset(foundRelease, architecture, process.platform);
|
const foundAsset = findAsset(foundRelease, architecture, process.platform);
|
||||||
|
@ -227,7 +223,7 @@ export function findAsset(
|
||||||
: platform === 'darwin'
|
: platform === 'darwin'
|
||||||
? 'macos'
|
? 'macos'
|
||||||
: platform;
|
: platform;
|
||||||
if (item.assets.length) {
|
if (item.assets.length) {
|
||||||
return item.assets.find((file: IGraalPyManifestAsset) => {
|
return item.assets.find((file: IGraalPyManifestAsset) => {
|
||||||
const match_data = file.name.match(
|
const match_data = file.name.match(
|
||||||
'.*(macos|linux|windows)-(amd64|aarch64).tar.gz$'
|
'.*(macos|linux|windows)-(amd64|aarch64).tar.gz$'
|
||||||
|
|
Loading…
Add table
Reference in a new issue