Skip to content

Commit

Permalink
Update with nits
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Aug 26, 2024
1 parent 0c4090e commit c9c4c80
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
13 changes: 6 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions src/backtrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
* @packageDocumentation
* Collects backtraces for executables for diagnostics
*/
import { isLinux, isMacOS } from "./actions-core-platform.js";
import { stringifyError } from "./errors.js";
import * as actionsCore from "@actions/core";
import * as exec from "@actions/exec";
import { readFile, readdir } from "node:fs/promises";
import { promisify } from "node:util";
import { gzip } from "node:zlib";
import os from "os";

export async function collectBacktraces(
prefixes: string[],
): Promise<Map<string, string>> {
if (os.platform() === "darwin") {
if (isMacOS) {
return await collectBacktracesMacOS(prefixes);
}
if (os.platform() === "linux") {
if (isLinux) {
return await collectBacktracesSystemd(prefixes);
}

Expand All @@ -37,7 +37,7 @@ export async function collectBacktracesMacOS(
"json",
"--last",
// Note we collect the last 1m only, because it should only take a few seconds to write the crash log.
// Therefor, any crashes before this 1m should be long done by now.
// Therefore, any crashes before this 1m should be long done by now.
"1m",
"--no-info",
"--predicate",
Expand All @@ -61,7 +61,7 @@ export async function collectBacktracesMacOS(
}
} catch (e: unknown) {
actionsCore.debug(
"Failed to check logs for in-progress crash dumps, assuming there are none.",
"Failed to check logs for in-progress crash dumps; now proceeding with the assumption that all crash dumps completed.",
);
}

Expand Down Expand Up @@ -96,10 +96,10 @@ export async function collectBacktracesMacOS(
return backtraces;
}

interface SystemdCoreDumpInfo {
type SystemdCoreDumpInfo = {
exe: string;
pid: number;
}
};

export async function collectBacktracesSystemd(
prefixes: string[],
Expand Down

0 comments on commit c9c4c80

Please sign in to comment.