1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-python synced 2025-06-15 07:24:14 +02:00

Add OS info to the error message (#559)

This commit is contained in:
MaksimZhukov 2022-12-07 18:12:42 +01:00 committed by GitHub
parent 76bbdfadd7
commit 2c3dd9e7e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 125 additions and 42 deletions

View file

@ -1,6 +1,6 @@
import * as os from 'os';
import * as path from 'path';
import {IS_WINDOWS, IS_LINUX} from './utils';
import {IS_WINDOWS, IS_LINUX, getOSInfo} from './utils';
import * as semver from 'semver';
@ -85,9 +85,14 @@ export async function useCpythonVersion(
}
if (!installDir) {
const osInfo = await getOSInfo();
throw new Error(
[
`Version ${version} with arch ${architecture} not found`,
`The version '${version}' with architecture '${architecture}' was not found for ${
osInfo
? `${osInfo.osName} ${osInfo.osVersion}`
: 'this operating system'
}.`,
`The list of all available versions can be found here: ${installer.MANIFEST_URL}`
].join(os.EOL)
);