Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
tweak logs
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Jul 17, 2024
1 parent 2292e1d commit da0170a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/activate.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ async function Run() {
}, 3);
} catch (error) {
core.setFailed(`Unity License Activation Failed! ${error.message}`);
PrintLogs();
GetLogs();
}
}

Expand Down Expand Up @@ -275,15 +275,16 @@ const hasExistingLicense = () => {
return false;
};

const PrintLogs = () => {
const GetLogs = () => {
const licenseLogs = {
win32: path.resolve(process.env.APPDATA || '', 'Unity', 'Unity.Licensing.Client.log'),
darwin: path.resolve(process.env.HOME || '', 'Library', 'Logs', 'Unity', 'Unity.Licensing.Client.log'),
linux: path.resolve(process.env.HOME || '', '.config', 'unity3d', 'Unity', 'Unity.Licensing.Client.log')
};

core.debug(`Unity Licensing Client Log: ${licenseLogs[process.platform]}`);

if (fs.existsSync(licenseLogs[process.platform])) {
core.debug(`Unity Licensing Client Log: ${licenseLogs[process.platform]}`);
copyFileToWorkspace(licenseLogs[process.platform], 'Unity.Licensing.Client.log');
} else {
core.warning(`Unity Licensing Client Log: ${licenseLogs[process.platform]} not found!`);
Expand All @@ -295,8 +296,9 @@ const PrintLogs = () => {
linux: path.resolve(process.env.HOME || '', '.config', 'UnityHub', 'logs', 'info-log.json')
};

core.debug(`Unity Hub Log: ${hubLogs[process.platform]}`);

if (fs.existsSync(hubLogs[process.platform])) {
core.debug(`Unity Hub Log: ${hubLogs[process.platform]}`);
copyFileToWorkspace(hubLogs[process.platform], 'UnityHub.log');
} else {
core.warning(`Unity Hub Log: ${hubLogs[process.platform]} not found!`);
Expand Down

0 comments on commit da0170a

Please sign in to comment.