mirror of
https://github.com/github/codeql-action.git
synced 2025-12-31 19:50:32 +08:00
Improve method naming
This commit is contained in:
@@ -9,7 +9,7 @@ import * as semver from "semver";
|
||||
|
||||
import { CommandInvocationError } from "./actions-util";
|
||||
import { Logger } from "./logging";
|
||||
import { assertNever, cleanUpGlob, isBinaryAccessible } from "./util";
|
||||
import { assertNever, cleanUpPath, isBinaryAccessible } from "./util";
|
||||
|
||||
const MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3";
|
||||
const MIN_REQUIRED_GNU_TAR_VERSION = "1.31";
|
||||
@@ -217,7 +217,7 @@ export async function extractTarZst(
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
await cleanUpGlob(dest, "extraction destination directory", logger);
|
||||
await cleanUpPath(dest, "extraction destination directory", logger);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import * as semver from "semver";
|
||||
|
||||
import { formatDuration, Logger } from "./logging";
|
||||
import * as tar from "./tar";
|
||||
import { cleanUpGlob, getErrorMessage, getRequiredEnvParam } from "./util";
|
||||
import { cleanUpPath, getErrorMessage, getRequiredEnvParam } from "./util";
|
||||
|
||||
/**
|
||||
* High watermark to use when streaming the download and extraction of the CodeQL tools.
|
||||
@@ -130,7 +130,7 @@ export async function downloadAndExtract(
|
||||
|
||||
// If we failed during processing, we want to clean up the destination directory
|
||||
// before we try again.
|
||||
await cleanUpGlob(dest, "CodeQL bundle", logger);
|
||||
await cleanUpPath(dest, "CodeQL bundle", logger);
|
||||
}
|
||||
|
||||
const toolsDownloadStart = performance.now();
|
||||
@@ -167,7 +167,7 @@ export async function downloadAndExtract(
|
||||
)}).`,
|
||||
);
|
||||
} finally {
|
||||
await cleanUpGlob(archivedBundlePath, "CodeQL bundle archive", logger);
|
||||
await cleanUpPath(archivedBundlePath, "CodeQL bundle archive", logger);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -1262,10 +1262,10 @@ export async function checkSipEnablement(
|
||||
}
|
||||
}
|
||||
|
||||
export async function cleanUpGlob(glob: string, name: string, logger: Logger) {
|
||||
export async function cleanUpPath(file: string, name: string, logger: Logger) {
|
||||
logger.debug(`Cleaning up ${name}.`);
|
||||
try {
|
||||
await fs.promises.rm(glob, {
|
||||
await fs.promises.rm(file, {
|
||||
force: true,
|
||||
recursive: true,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user