mirror of
https://github.com/actions/setup-python.git
synced 2026-01-23 06:58:54 +08:00
Add try catch
This commit is contained in:
parent
1d95b404f2
commit
d4d6125cf2
2 changed files with 28 additions and 15 deletions
21
src/utils.ts
21
src/utils.ts
|
|
@ -179,13 +179,18 @@ async function getLinuxInfo() {
|
|||
|
||||
export async function getOSInfo() {
|
||||
let osInfo;
|
||||
if (IS_WINDOWS) {
|
||||
osInfo = await getWindowsInfo();
|
||||
} else if (IS_LINUX) {
|
||||
osInfo = await getLinuxInfo();
|
||||
} else if (IS_MAC) {
|
||||
osInfo = await getMacOSInfo();
|
||||
try {
|
||||
if (IS_WINDOWS) {
|
||||
osInfo = await getWindowsInfo();
|
||||
} else if (IS_LINUX) {
|
||||
osInfo = await getLinuxInfo();
|
||||
} else if (IS_MAC) {
|
||||
osInfo = await getMacOSInfo();
|
||||
}
|
||||
} catch (err) {
|
||||
const error = err as Error;
|
||||
core.debug(error.message);
|
||||
} finally {
|
||||
return osInfo;
|
||||
}
|
||||
|
||||
return osInfo;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue