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:
parent
76bbdfadd7
commit
2c3dd9e7e2
5 changed files with 125 additions and 42 deletions
|
@ -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)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue