8000 Add OS info to the error message by MaksimZhukov · Pull Request #559 · actions/setup-python · GitHub
[go: up one dir, main page]

Skip to content

Add OS info to the error message #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add try catch
  • Loading branch information
MaksimZhukov committed Dec 6, 2022
commit d4d6125cf2e5750c715c4655dbddf35b2db6fa2b
22 changes: 15 additions & 7 deletions dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67089,16 +67089,24 @@ function getLinuxInfo() {
function getOSInfo() {
return __awaiter(this, void 0, void 0, function* () {
let osInfo;
if (exports.IS_WINDOWS) {
osInfo = yield getWindowsInfo();
try {
if (exports.IS_WINDOWS) {
osInfo = yield getWindowsInfo();
}
else if (exports.IS_LINUX) {
osInfo = yield getLinuxInfo();
}
else if (exports.IS_MAC) {
osInfo = yield getMacOSInfo();
}
}
else if (exports.IS_LINUX) {
osInfo = yield getLinuxInfo();
catch (err) {
const error = err;
core.debug(error.message);
}
else if (exports.IS_MAC) {
osInfo = yield getMacOSInfo();
finally {
return osInfo;
}
return osInfo;
});
}
exports.getOSInfo = getOSInfo;
Expand Down
21 changes: 13 additions & 8 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
0