From 949e4cfa9aee5b1d7941a14f20002c9a9e687976 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 13 Nov 2023 08:07:21 +0000 Subject: [PATCH 1/2] Add logging if file size does not match --- FlowPlugins/FlowHelpers/1.0.0/fileUtils.js | 8 ++++++++ FlowPluginsTs/FlowHelpers/1.0.0/fileUtils.ts | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/FlowPlugins/FlowHelpers/1.0.0/fileUtils.js b/FlowPlugins/FlowHelpers/1.0.0/fileUtils.js index 5980e9a..2e5963a 100644 --- a/FlowPlugins/FlowHelpers/1.0.0/fileUtils.js +++ b/FlowPlugins/FlowHelpers/1.0.0/fileUtils.js @@ -117,6 +117,10 @@ var moveFileAndValidate = function (_a) { return [3 /*break*/, 6]; case 6: if (!(!res1 || inputSize !== outputSize)) return [3 /*break*/, 9]; + if (inputSize !== outputSize) { + args.jobLog("File sizes do not match, input: ".concat(inputSize, " ") + + "does not equal output: ".concat(outputSize)); + } args.jobLog("Attempt 1 failed: Moving file from ".concat(inputPath, " to ").concat(outputPath)); args.jobLog("Attempt 2: Moving file from ".concat(inputPath, " to ").concat(outputPath)); return [4 /*yield*/, new Promise(function (resolve) { @@ -135,6 +139,10 @@ var moveFileAndValidate = function (_a) { case 8: outputSize = _b.sent(); if (!res2 || inputSize !== outputSize) { + if (inputSize !== outputSize) { + args.jobLog("File sizes do not match, input: ".concat(inputSize, " ") + + "does not equal output: ".concat(outputSize)); + } errMessage = "Failed to move file from ".concat(inputPath, " to ").concat(outputPath, ", check errors above"); args.jobLog(errMessage); throw new Error(errMessage); diff --git a/FlowPluginsTs/FlowHelpers/1.0.0/fileUtils.ts b/FlowPluginsTs/FlowHelpers/1.0.0/fileUtils.ts index 018f9a7..bb2fb1b 100644 --- a/FlowPluginsTs/FlowHelpers/1.0.0/fileUtils.ts +++ b/FlowPluginsTs/FlowHelpers/1.0.0/fileUtils.ts @@ -75,6 +75,11 @@ export const moveFileAndValidate = async ({ } if (!res1 || inputSize !== outputSize) { + if (inputSize !== outputSize) { + args.jobLog(`File sizes do not match, input: ${inputSize} ` + + `does not equal output: ${outputSize}`); + } + args.jobLog(`Attempt 1 failed: Moving file from ${inputPath} to ${outputPath}`); args.jobLog(`Attempt 2: Moving file from ${inputPath} to ${outputPath}`); @@ -92,6 +97,11 @@ export const moveFileAndValidate = async ({ outputSize = await getFileSize(outputPath); if (!res2 || inputSize !== outputSize) { + if (inputSize !== outputSize) { + args.jobLog(`File sizes do not match, input: ${inputSize} ` + + `does not equal output: ${outputSize}`); + } + const errMessage = `Failed to move file from ${inputPath} to ${outputPath}, check errors above`; args.jobLog(errMessage); throw new Error(errMessage); From 45180c910f1583a932047e3a5d998a306e9b30f8 Mon Sep 17 00:00:00 2001 From: HaveAGitGat <43864057+HaveAGitGat@users.noreply.github.com> Date: Mon, 13 Nov 2023 08:07:27 +0000 Subject: [PATCH 2/2] Use lf --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..94f480d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file