mirror of
https://github.com/github/codeql-action.git
synced 2026-10-21 02:01:27 +00:00
Address EXDEV issue
This commit is contained in:
15
lib/entry-points.js
generated
15
lib/entry-points.js
generated
@@ -170021,6 +170021,9 @@ function wrapError(error3) {
|
||||
function getErrorMessage(error3) {
|
||||
return error3 instanceof Error ? error3.message : String(error3);
|
||||
}
|
||||
function isErrnoException(error3) {
|
||||
return typeof error3 === "object" && error3 !== null && "code" in error3 && typeof error3.code === "string";
|
||||
}
|
||||
function prettyPrintPack(pack) {
|
||||
return `${pack.name}${pack.version ? `@${pack.version}` : ""}${pack.path ? `:${pack.path}` : ""}`;
|
||||
}
|
||||
@@ -173099,10 +173102,18 @@ function flushDiagnostics(action, config) {
|
||||
const destination = import_path2.default.join(directory, filename);
|
||||
try {
|
||||
fs7.mkdirSync(directory, { recursive: true });
|
||||
fs7.renameSync(temporary.path, destination);
|
||||
try {
|
||||
fs7.renameSync(temporary.path, destination);
|
||||
} catch (renameErr) {
|
||||
if (!isErrnoException(renameErr) || renameErr.code !== "EXDEV") {
|
||||
throw renameErr;
|
||||
}
|
||||
fs7.copyFileSync(temporary.path, destination);
|
||||
fs7.unlinkSync(temporary.path);
|
||||
}
|
||||
} catch (err) {
|
||||
action.logger.warning(
|
||||
`Failed to rename '${temporary.path}' to '${destination}': ${getErrorMessage(err)}`
|
||||
`Failed to relocate '${temporary.path}' to '${destination}': ${getErrorMessage(err)}`
|
||||
);
|
||||
failedFlushDiagnostics.push(temporary);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user